﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace Unity.Linq
{
	// Token: 0x02000079 RID: 121
	public static class GameObjectExtensions
	{
		// Token: 0x060003BF RID: 959 RVA: 0x0001888C File Offset: 0x00016A8C
		public static IEnumerable<GameObject> Ancestors(this IEnumerable<GameObject> source)
		{
			foreach (GameObject item in source)
			{
				foreach (GameObject gameObject in item.Ancestors())
				{
					yield return gameObject;
				}
			}
			yield break;
		}

		// Token: 0x060003C0 RID: 960 RVA: 0x000188B0 File Offset: 0x00016AB0
		public static IEnumerable<GameObject> AncestorsAndSelf(this IEnumerable<GameObject> source)
		{
			foreach (GameObject item in source)
			{
				foreach (GameObject gameObject in item.AncestorsAndSelf())
				{
					yield return gameObject;
				}
			}
			yield break;
		}

		// Token: 0x060003C1 RID: 961 RVA: 0x000188D4 File Offset: 0x00016AD4
		public static IEnumerable<GameObject> Descendants(this IEnumerable<GameObject> source, Func<Transform, bool> descendIntoChildren = null)
		{
			foreach (GameObject item in source)
			{
				foreach (GameObject gameObject in item.Descendants(descendIntoChildren))
				{
					yield return gameObject;
				}
			}
			yield break;
		}

		// Token: 0x060003C2 RID: 962 RVA: 0x00018900 File Offset: 0x00016B00
		public static IEnumerable<GameObject> DescendantsAndSelf(this IEnumerable<GameObject> source, Func<Transform, bool> descendIntoChildren = null)
		{
			foreach (GameObject item in source)
			{
				foreach (GameObject gameObject in item.DescendantsAndSelf(descendIntoChildren))
				{
					yield return gameObject;
				}
			}
			yield break;
		}

		// Token: 0x060003C3 RID: 963 RVA: 0x0001892C File Offset: 0x00016B2C
		public static IEnumerable<GameObject> Children(this IEnumerable<GameObject> source)
		{
			foreach (GameObject item in source)
			{
				foreach (GameObject gameObject in item.Children())
				{
					yield return gameObject;
				}
			}
			yield break;
		}

		// Token: 0x060003C4 RID: 964 RVA: 0x00018950 File Offset: 0x00016B50
		public static IEnumerable<GameObject> ChildrenAndSelf(this IEnumerable<GameObject> source)
		{
			foreach (GameObject item in source)
			{
				foreach (GameObject gameObject in item.ChildrenAndSelf())
				{
					yield return gameObject;
				}
			}
			yield break;
		}

		// Token: 0x060003C5 RID: 965 RVA: 0x00018974 File Offset: 0x00016B74
		public static void Destroy(this IEnumerable<GameObject> source, bool useDestroyImmediate = false, bool detachParent = false)
		{
			if (detachParent)
			{
				List<GameObject> list = new List<GameObject>(source);
				foreach (GameObject self in list)
				{
					self.Destroy(useDestroyImmediate, true);
				}
			}
			else
			{
				foreach (GameObject self2 in source)
				{
					self2.Destroy(useDestroyImmediate, false);
				}
			}
		}

		// Token: 0x060003C6 RID: 966 RVA: 0x00018A04 File Offset: 0x00016C04
		public static IEnumerable<T> OfComponent<T>(this IEnumerable<GameObject> source) where T : Component
		{
			foreach (GameObject item in source)
			{
				T component = item.GetComponent<T>();
				if (component != null)
				{
					yield return component;
				}
			}
			yield break;
		}

		// Token: 0x060003C7 RID: 967 RVA: 0x00018A28 File Offset: 0x00016C28
		public static int ToArrayNonAlloc<T>(this IEnumerable<T> source, ref T[] array)
		{
			int num = 0;
			foreach (T t in source)
			{
				if (array.Length == num)
				{
					int newSize = (num != 0) ? (num * 2) : 4;
					Array.Resize<T>(ref array, newSize);
				}
				array[num++] = t;
			}
			return num;
		}

		// Token: 0x060003C8 RID: 968 RVA: 0x00018AA8 File Offset: 0x00016CA8
		private static GameObject GetGameObject<T>(T obj) where T : UnityEngine.Object
		{
			GameObject gameObject = obj as GameObject;
			if (gameObject == null)
			{
				Component component = obj as Component;
				if (component == null)
				{
					return null;
				}
				gameObject = component.gameObject;
			}
			return gameObject;
		}

		// Token: 0x060003C9 RID: 969 RVA: 0x00018AF0 File Offset: 0x00016CF0
		public static T Add<T>(this GameObject parent, T childOriginal, TransformCloneType cloneType = TransformCloneType.KeepOriginal, bool? setActive = null, string specifiedName = null, bool setLayer = false) where T : UnityEngine.Object
		{
			if (parent == null)
			{
				throw new ArgumentNullException("parent");
			}
			if (childOriginal == null)
			{
				throw new ArgumentNullException("childOriginal");
			}
			T t = UnityEngine.Object.Instantiate<T>(childOriginal);
			GameObject gameObject = GameObjectExtensions.GetGameObject<T>(t);
			Transform transform = gameObject.transform;
			RectTransform rectTransform = transform as RectTransform;
			if (rectTransform != null)
			{
				rectTransform.SetParent(parent.transform, false);
			}
			else
			{
				Transform transform2 = parent.transform;
				transform.parent = transform2;
				switch (cloneType)
				{
				case TransformCloneType.KeepOriginal:
				{
					GameObject gameObject2 = GameObjectExtensions.GetGameObject<T>(childOriginal);
					Transform transform3 = gameObject2.transform;
					transform.localPosition = transform3.localPosition;
					transform.localScale = transform3.localScale;
					transform.localRotation = transform3.localRotation;
					break;
				}
				case TransformCloneType.FollowParent:
					transform.localPosition = transform2.localPosition;
					transform.localScale = transform2.localScale;
					transform.localRotation = transform2.localRotation;
					break;
				case TransformCloneType.Origin:
					transform.localPosition = Vector3.zero;
					transform.localScale = Vector3.one;
					transform.localRotation = Quaternion.identity;
					break;
				}
			}
			if (setLayer)
			{
				gameObject.layer = parent.layer;
			}
			if (setActive != null)
			{
				gameObject.SetActive(setActive.Value);
			}
			if (specifiedName != null)
			{
				t.name = specifiedName;
			}
			return t;
		}

		// Token: 0x060003CA RID: 970 RVA: 0x00018C6C File Offset: 0x00016E6C
		public static T[] AddRange<T>(this GameObject parent, IEnumerable<T> childOriginals, TransformCloneType cloneType = TransformCloneType.KeepOriginal, bool? setActive = null, string specifiedName = null, bool setLayer = false) where T : UnityEngine.Object
		{
			if (parent == null)
			{
				throw new ArgumentNullException("parent");
			}
			if (childOriginals == null)
			{
				throw new ArgumentNullException("childOriginals");
			}
			T[] array = childOriginals as T[];
			if (array != null)
			{
				T[] array2 = new T[array.Length];
				for (int i = 0; i < array.Length; i++)
				{
					T t = parent.Add(array[i], cloneType, setActive, specifiedName, setLayer);
					array2[i] = t;
				}
				return array2;
			}
			IList<T> list = childOriginals as IList<T>;
			if (list != null)
			{
				T[] array3 = new T[list.Count];
				for (int j = 0; j < list.Count; j++)
				{
					T t2 = parent.Add(list[j], cloneType, setActive, specifiedName, setLayer);
					array3[j] = t2;
				}
				return array3;
			}
			List<T> list2 = new List<T>();
			foreach (T childOriginal in childOriginals)
			{
				T item = parent.Add(childOriginal, cloneType, setActive, specifiedName, setLayer);
				list2.Add(item);
			}
			return list2.ToArray();
		}

		// Token: 0x060003CB RID: 971 RVA: 0x00018DB4 File Offset: 0x00016FB4
		public static T AddFirst<T>(this GameObject parent, T childOriginal, TransformCloneType cloneType = TransformCloneType.KeepOriginal, bool? setActive = null, string specifiedName = null, bool setLayer = false) where T : UnityEngine.Object
		{
			T t = parent.Add(childOriginal, cloneType, setActive, specifiedName, setLayer);
			GameObject gameObject = GameObjectExtensions.GetGameObject<T>(t);
			if (gameObject == null)
			{
				return t;
			}
			gameObject.transform.SetAsFirstSibling();
			return t;
		}

		// Token: 0x060003CC RID: 972 RVA: 0x00018DF0 File Offset: 0x00016FF0
		public static T[] AddFirstRange<T>(this GameObject parent, IEnumerable<T> childOriginals, TransformCloneType cloneType = TransformCloneType.KeepOriginal, bool? setActive = null, string specifiedName = null, bool setLayer = false) where T : UnityEngine.Object
		{
			T[] array = parent.AddRange(childOriginals, cloneType, setActive, specifiedName, setLayer);
			for (int i = array.Length - 1; i >= 0; i--)
			{
				GameObject gameObject = GameObjectExtensions.GetGameObject<T>(array[i]);
				if (!(gameObject == null))
				{
					gameObject.transform.SetAsFirstSibling();
				}
			}
			return array;
		}

		// Token: 0x060003CD RID: 973 RVA: 0x00018E4C File Offset: 0x0001704C
		public static T AddBeforeSelf<T>(this GameObject parent, T childOriginal, TransformCloneType cloneType = TransformCloneType.KeepOriginal, bool? setActive = null, string specifiedName = null, bool setLayer = false) where T : UnityEngine.Object
		{
			GameObject gameObject = parent.Parent();
			if (gameObject == null)
			{
				throw new InvalidOperationException("The parent root is null");
			}
			int siblingIndex = parent.transform.GetSiblingIndex();
			T t = gameObject.Add(childOriginal, cloneType, setActive, specifiedName, setLayer);
			GameObject gameObject2 = GameObjectExtensions.GetGameObject<T>(t);
			if (gameObject2 == null)
			{
				return t;
			}
			gameObject2.transform.SetSiblingIndex(siblingIndex);
			return t;
		}

		// Token: 0x060003CE RID: 974 RVA: 0x00018EB4 File Offset: 0x000170B4
		public static T[] AddBeforeSelfRange<T>(this GameObject parent, IEnumerable<T> childOriginals, TransformCloneType cloneType = TransformCloneType.KeepOriginal, bool? setActive = null, string specifiedName = null, bool setLayer = false) where T : UnityEngine.Object
		{
			GameObject gameObject = parent.Parent();
			if (gameObject == null)
			{
				throw new InvalidOperationException("The parent root is null");
			}
			int siblingIndex = parent.transform.GetSiblingIndex();
			T[] array = gameObject.AddRange(childOriginals, cloneType, setActive, specifiedName, setLayer);
			for (int i = array.Length - 1; i >= 0; i--)
			{
				GameObject gameObject2 = GameObjectExtensions.GetGameObject<T>(array[i]);
				if (!(gameObject2 == null))
				{
					gameObject2.transform.SetSiblingIndex(siblingIndex);
				}
			}
			return array;
		}

		// Token: 0x060003CF RID: 975 RVA: 0x00018F40 File Offset: 0x00017140
		public static T AddAfterSelf<T>(this GameObject parent, T childOriginal, TransformCloneType cloneType = TransformCloneType.KeepOriginal, bool? setActive = null, string specifiedName = null, bool setLayer = false) where T : UnityEngine.Object
		{
			GameObject gameObject = parent.Parent();
			if (gameObject == null)
			{
				throw new InvalidOperationException("The parent root is null");
			}
			int siblingIndex = parent.transform.GetSiblingIndex() + 1;
			T t = gameObject.Add(childOriginal, cloneType, setActive, specifiedName, setLayer);
			GameObject gameObject2 = GameObjectExtensions.GetGameObject<T>(t);
			if (gameObject2 == null)
			{
				return t;
			}
			gameObject2.transform.SetSiblingIndex(siblingIndex);
			return t;
		}

		// Token: 0x060003D0 RID: 976 RVA: 0x00018FAC File Offset: 0x000171AC
		public static T[] AddAfterSelfRange<T>(this GameObject parent, IEnumerable<T> childOriginals, TransformCloneType cloneType = TransformCloneType.KeepOriginal, bool? setActive = null, string specifiedName = null, bool setLayer = false) where T : UnityEngine.Object
		{
			GameObject gameObject = parent.Parent();
			if (gameObject == null)
			{
				throw new InvalidOperationException("The parent root is null");
			}
			int siblingIndex = parent.transform.GetSiblingIndex() + 1;
			T[] array = gameObject.AddRange(childOriginals, cloneType, setActive, specifiedName, setLayer);
			for (int i = array.Length - 1; i >= 0; i--)
			{
				GameObject gameObject2 = GameObjectExtensions.GetGameObject<T>(array[i]);
				if (!(gameObject2 == null))
				{
					gameObject2.transform.SetSiblingIndex(siblingIndex);
				}
			}
			return array;
		}

		// Token: 0x060003D1 RID: 977 RVA: 0x00019038 File Offset: 0x00017238
		public static T MoveToLast<T>(this GameObject parent, T child, TransformMoveType moveType = TransformMoveType.DoNothing, bool? setActive = null, bool setLayer = false) where T : UnityEngine.Object
		{
			if (parent == null)
			{
				throw new ArgumentNullException("parent");
			}
			if (child == null)
			{
				throw new ArgumentNullException("child");
			}
			GameObject gameObject = GameObjectExtensions.GetGameObject<T>(child);
			if (child == null)
			{
				return child;
			}
			Transform transform = gameObject.transform;
			RectTransform rectTransform = transform as RectTransform;
			if (rectTransform != null)
			{
				rectTransform.SetParent(parent.transform, false);
			}
			else
			{
				Transform transform2 = parent.transform;
				transform.parent = transform2;
				switch (moveType)
				{
				case TransformMoveType.FollowParent:
					transform.localPosition = transform2.localPosition;
					transform.localScale = transform2.localScale;
					transform.localRotation = transform2.localRotation;
					break;
				case TransformMoveType.Origin:
					transform.localPosition = Vector3.zero;
					transform.localScale = Vector3.one;
					transform.localRotation = Quaternion.identity;
					break;
				}
			}
			if (setLayer)
			{
				gameObject.layer = parent.layer;
			}
			if (setActive != null)
			{
				gameObject.SetActive(setActive.Value);
			}
			return child;
		}

		// Token: 0x060003D2 RID: 978 RVA: 0x00019164 File Offset: 0x00017364
		public static T[] MoveToLastRange<T>(this GameObject parent, IEnumerable<T> childs, TransformMoveType moveType = TransformMoveType.DoNothing, bool? setActive = null, bool setLayer = false) where T : UnityEngine.Object
		{
			if (parent == null)
			{
				throw new ArgumentNullException("parent");
			}
			if (childs == null)
			{
				throw new ArgumentNullException("childs");
			}
			T[] array = childs as T[];
			if (array != null)
			{
				T[] array2 = new T[array.Length];
				for (int i = 0; i < array.Length; i++)
				{
					T t = parent.MoveToLast(array[i], moveType, setActive, setLayer);
					array2[i] = t;
				}
				return array2;
			}
			IList<T> list = childs as IList<T>;
			if (list != null)
			{
				T[] array3 = new T[list.Count];
				for (int j = 0; j < list.Count; j++)
				{
					T t2 = parent.MoveToLast(list[j], moveType, setActive, setLayer);
					array3[j] = t2;
				}
				return array3;
			}
			List<T> list2 = new List<T>();
			foreach (T child in childs)
			{
				T item = parent.MoveToLast(child, moveType, setActive, setLayer);
				list2.Add(item);
			}
			return list2.ToArray();
		}

		// Token: 0x060003D3 RID: 979 RVA: 0x000192A8 File Offset: 0x000174A8
		public static T MoveToFirst<T>(this GameObject parent, T child, TransformMoveType moveType = TransformMoveType.DoNothing, bool? setActive = null, bool setLayer = false) where T : UnityEngine.Object
		{
			parent.MoveToLast(child, moveType, setActive, setLayer);
			GameObject gameObject = GameObjectExtensions.GetGameObject<T>(child);
			if (gameObject == null)
			{
				return child;
			}
			gameObject.transform.SetAsFirstSibling();
			return child;
		}

		// Token: 0x060003D4 RID: 980 RVA: 0x000192E4 File Offset: 0x000174E4
		public static T[] MoveToFirstRange<T>(this GameObject parent, IEnumerable<T> childs, TransformMoveType moveType = TransformMoveType.DoNothing, bool? setActive = null, bool setLayer = false) where T : UnityEngine.Object
		{
			T[] array = parent.MoveToLastRange(childs, moveType, setActive, setLayer);
			for (int i = array.Length - 1; i >= 0; i--)
			{
				GameObject gameObject = GameObjectExtensions.GetGameObject<T>(array[i]);
				if (!(gameObject == null))
				{
					gameObject.transform.SetAsFirstSibling();
				}
			}
			return array;
		}

		// Token: 0x060003D5 RID: 981 RVA: 0x00019340 File Offset: 0x00017540
		public static T MoveToBeforeSelf<T>(this GameObject parent, T child, TransformMoveType moveType = TransformMoveType.DoNothing, bool? setActive = null, bool setLayer = false) where T : UnityEngine.Object
		{
			GameObject gameObject = parent.Parent();
			if (gameObject == null)
			{
				throw new InvalidOperationException("The parent root is null");
			}
			int siblingIndex = parent.transform.GetSiblingIndex();
			gameObject.MoveToLast(child, moveType, setActive, setLayer);
			GameObject gameObject2 = GameObjectExtensions.GetGameObject<T>(child);
			if (gameObject2 == null)
			{
				return child;
			}
			gameObject2.transform.SetSiblingIndex(siblingIndex);
			return child;
		}

		// Token: 0x060003D6 RID: 982 RVA: 0x000193A8 File Offset: 0x000175A8
		public static T[] MoveToBeforeSelfRange<T>(this GameObject parent, IEnumerable<T> childs, TransformMoveType moveType = TransformMoveType.DoNothing, bool? setActive = null, bool setLayer = false) where T : UnityEngine.Object
		{
			GameObject gameObject = parent.Parent();
			if (gameObject == null)
			{
				throw new InvalidOperationException("The parent root is null");
			}
			int siblingIndex = parent.transform.GetSiblingIndex();
			T[] array = gameObject.MoveToLastRange(childs, moveType, setActive, setLayer);
			for (int i = array.Length - 1; i >= 0; i--)
			{
				GameObject gameObject2 = GameObjectExtensions.GetGameObject<T>(array[i]);
				if (!(gameObject2 == null))
				{
					gameObject2.transform.SetSiblingIndex(siblingIndex);
				}
			}
			return array;
		}

		// Token: 0x060003D7 RID: 983 RVA: 0x00019430 File Offset: 0x00017630
		public static T MoveToAfterSelf<T>(this GameObject parent, T child, TransformMoveType moveType = TransformMoveType.DoNothing, bool? setActive = null, bool setLayer = false) where T : UnityEngine.Object
		{
			GameObject gameObject = parent.Parent();
			if (gameObject == null)
			{
				throw new InvalidOperationException("The parent root is null");
			}
			int siblingIndex = parent.transform.GetSiblingIndex() + 1;
			gameObject.MoveToLast(child, moveType, setActive, setLayer);
			GameObject gameObject2 = GameObjectExtensions.GetGameObject<T>(child);
			if (gameObject2 == null)
			{
				return child;
			}
			gameObject2.transform.SetSiblingIndex(siblingIndex);
			return child;
		}

		// Token: 0x060003D8 RID: 984 RVA: 0x00019498 File Offset: 0x00017698
		public static T[] MoveToAfterSelfRange<T>(this GameObject parent, IEnumerable<T> childs, TransformMoveType moveType = TransformMoveType.DoNothing, bool? setActive = null, bool setLayer = false) where T : UnityEngine.Object
		{
			GameObject gameObject = parent.Parent();
			if (gameObject == null)
			{
				throw new InvalidOperationException("The parent root is null");
			}
			int siblingIndex = parent.transform.GetSiblingIndex() + 1;
			T[] array = gameObject.MoveToLastRange(childs, moveType, setActive, setLayer);
			for (int i = array.Length - 1; i >= 0; i--)
			{
				GameObject gameObject2 = GameObjectExtensions.GetGameObject<T>(array[i]);
				if (!(gameObject2 == null))
				{
					gameObject2.transform.SetSiblingIndex(siblingIndex);
				}
			}
			return array;
		}

		// Token: 0x060003D9 RID: 985 RVA: 0x00019524 File Offset: 0x00017724
		public static void Destroy(this GameObject self, bool useDestroyImmediate = false, bool detachParent = false)
		{
			if (self == null)
			{
				return;
			}
			if (detachParent)
			{
				self.transform.SetParent(null);
			}
			if (useDestroyImmediate)
			{
				UnityEngine.Object.DestroyImmediate(self);
			}
			else
			{
				UnityEngine.Object.Destroy(self);
			}
		}

		// Token: 0x060003DA RID: 986 RVA: 0x0001955C File Offset: 0x0001775C
		public static GameObject Parent(this GameObject origin)
		{
			if (origin == null)
			{
				return null;
			}
			Transform parent = origin.transform.parent;
			if (parent == null)
			{
				return null;
			}
			return parent.gameObject;
		}

		// Token: 0x060003DB RID: 987 RVA: 0x00019598 File Offset: 0x00017798
		public static GameObject Child(this GameObject origin, string name)
		{
			if (origin == null)
			{
				return null;
			}
			Transform transform = origin.transform.Find(name);
			if (transform == null)
			{
				return null;
			}
			return transform.gameObject;
		}

		// Token: 0x060003DC RID: 988 RVA: 0x000195D4 File Offset: 0x000177D4
		public static GameObjectExtensions.ChildrenEnumerable Children(this GameObject origin)
		{
			return new GameObjectExtensions.ChildrenEnumerable(origin, false);
		}

		// Token: 0x060003DD RID: 989 RVA: 0x000195E0 File Offset: 0x000177E0
		public static GameObjectExtensions.ChildrenEnumerable ChildrenAndSelf(this GameObject origin)
		{
			return new GameObjectExtensions.ChildrenEnumerable(origin, true);
		}

		// Token: 0x060003DE RID: 990 RVA: 0x000195EC File Offset: 0x000177EC
		public static GameObjectExtensions.AncestorsEnumerable Ancestors(this GameObject origin)
		{
			return new GameObjectExtensions.AncestorsEnumerable(origin, false);
		}

		// Token: 0x060003DF RID: 991 RVA: 0x000195F8 File Offset: 0x000177F8
		public static GameObjectExtensions.AncestorsEnumerable AncestorsAndSelf(this GameObject origin)
		{
			return new GameObjectExtensions.AncestorsEnumerable(origin, true);
		}

		// Token: 0x060003E0 RID: 992 RVA: 0x00019604 File Offset: 0x00017804
		public static GameObjectExtensions.DescendantsEnumerable Descendants(this GameObject origin, Func<Transform, bool> descendIntoChildren = null)
		{
			return new GameObjectExtensions.DescendantsEnumerable(origin, false, descendIntoChildren);
		}

		// Token: 0x060003E1 RID: 993 RVA: 0x00019610 File Offset: 0x00017810
		public static GameObjectExtensions.DescendantsEnumerable DescendantsAndSelf(this GameObject origin, Func<Transform, bool> descendIntoChildren = null)
		{
			return new GameObjectExtensions.DescendantsEnumerable(origin, true, descendIntoChildren);
		}

		// Token: 0x060003E2 RID: 994 RVA: 0x0001961C File Offset: 0x0001781C
		public static GameObjectExtensions.BeforeSelfEnumerable BeforeSelf(this GameObject origin)
		{
			return new GameObjectExtensions.BeforeSelfEnumerable(origin, false);
		}

		// Token: 0x060003E3 RID: 995 RVA: 0x00019628 File Offset: 0x00017828
		public static GameObjectExtensions.BeforeSelfEnumerable BeforeSelfAndSelf(this GameObject origin)
		{
			return new GameObjectExtensions.BeforeSelfEnumerable(origin, true);
		}

		// Token: 0x060003E4 RID: 996 RVA: 0x00019634 File Offset: 0x00017834
		public static GameObjectExtensions.AfterSelfEnumerable AfterSelf(this GameObject origin)
		{
			return new GameObjectExtensions.AfterSelfEnumerable(origin, false);
		}

		// Token: 0x060003E5 RID: 997 RVA: 0x00019640 File Offset: 0x00017840
		public static GameObjectExtensions.AfterSelfEnumerable AfterSelfAndSelf(this GameObject origin)
		{
			return new GameObjectExtensions.AfterSelfEnumerable(origin, true);
		}

		// Token: 0x0200007A RID: 122
		public struct ChildrenEnumerable : IEnumerable<GameObject>, IEnumerable
		{
			// Token: 0x060003E6 RID: 998 RVA: 0x0001964C File Offset: 0x0001784C
			public ChildrenEnumerable(GameObject origin, bool withSelf)
			{
				this.origin = origin;
				this.withSelf = withSelf;
			}

			// Token: 0x060003E7 RID: 999 RVA: 0x0001965C File Offset: 0x0001785C
			public GameObjectExtensions.ChildrenEnumerable.OfComponentEnumerable<T> OfComponent<T>() where T : Component
			{
				return new GameObjectExtensions.ChildrenEnumerable.OfComponentEnumerable<T>(ref this);
			}

			// Token: 0x060003E8 RID: 1000 RVA: 0x00019664 File Offset: 0x00017864
			public void Destroy(bool useDestroyImmediate = false, bool detachParent = false)
			{
				foreach (GameObject self in this)
				{
					self.Destroy(useDestroyImmediate, false);
				}
				if (detachParent)
				{
					this.origin.transform.DetachChildren();
					if (this.withSelf)
					{
						this.origin.transform.SetParent(null);
					}
				}
			}

			// Token: 0x060003E9 RID: 1001 RVA: 0x000196CC File Offset: 0x000178CC
			public void Destroy(Func<GameObject, bool> predicate, bool useDestroyImmediate = false)
			{
				foreach (GameObject gameObject in this)
				{
					if (predicate(gameObject))
					{
						gameObject.Destroy(useDestroyImmediate, false);
					}
				}
			}

			// Token: 0x060003EA RID: 1002 RVA: 0x00019710 File Offset: 0x00017910
			public GameObjectExtensions.ChildrenEnumerable.Enumerator GetEnumerator()
			{
				return (!(this.origin == null)) ? new GameObjectExtensions.ChildrenEnumerable.Enumerator(this.origin.transform, this.withSelf, true) : new GameObjectExtensions.ChildrenEnumerable.Enumerator(null, this.withSelf, false);
			}

			// Token: 0x060003EB RID: 1003 RVA: 0x0001974C File Offset: 0x0001794C
			IEnumerator<GameObject> IEnumerable<GameObject>.GetEnumerator()
			{
				return this.GetEnumerator();
			}

			// Token: 0x060003EC RID: 1004 RVA: 0x0001975C File Offset: 0x0001795C
			IEnumerator IEnumerable.GetEnumerator()
			{
				return this.GetEnumerator();
			}

			// Token: 0x060003ED RID: 1005 RVA: 0x0001976C File Offset: 0x0001796C
			private int GetChildrenSize()
			{
				return this.origin.transform.childCount + ((!this.withSelf) ? 0 : 1);
			}

			// Token: 0x060003EE RID: 1006 RVA: 0x00019794 File Offset: 0x00017994
			public void ForEach(Action<GameObject> action)
			{
				foreach (GameObject obj in this)
				{
					action(obj);
				}
			}

			// Token: 0x060003EF RID: 1007 RVA: 0x000197C8 File Offset: 0x000179C8
			public int ToArrayNonAlloc(ref GameObject[] array)
			{
				int num = 0;
				foreach (GameObject gameObject in this)
				{
					if (array.Length == num)
					{
						int newSize = (num != 0) ? (num * 2) : this.GetChildrenSize();
						Array.Resize<GameObject>(ref array, newSize);
					}
					array[num++] = gameObject;
				}
				return num;
			}

			// Token: 0x060003F0 RID: 1008 RVA: 0x00019828 File Offset: 0x00017A28
			public int ToArrayNonAlloc(Func<GameObject, bool> filter, ref GameObject[] array)
			{
				int num = 0;
				foreach (GameObject gameObject in this)
				{
					if (filter(gameObject))
					{
						if (array.Length == num)
						{
							int newSize = (num != 0) ? (num * 2) : this.GetChildrenSize();
							Array.Resize<GameObject>(ref array, newSize);
						}
						array[num++] = gameObject;
					}
				}
				return num;
			}

			// Token: 0x060003F1 RID: 1009 RVA: 0x00019898 File Offset: 0x00017A98
			public int ToArrayNonAlloc<T>(Func<GameObject, T> selector, ref T[] array)
			{
				int num = 0;
				foreach (GameObject arg in this)
				{
					if (array.Length == num)
					{
						int newSize = (num != 0) ? (num * 2) : this.GetChildrenSize();
						Array.Resize<T>(ref array, newSize);
					}
					array[num++] = selector(arg);
				}
				return num;
			}

			// Token: 0x060003F2 RID: 1010 RVA: 0x00019904 File Offset: 0x00017B04
			public int ToArrayNonAlloc<T>(Func<GameObject, bool> filter, Func<GameObject, T> selector, ref T[] array)
			{
				int num = 0;
				foreach (GameObject arg in this)
				{
					if (filter(arg))
					{
						if (array.Length == num)
						{
							int newSize = (num != 0) ? (num * 2) : this.GetChildrenSize();
							Array.Resize<T>(ref array, newSize);
						}
						array[num++] = selector(arg);
					}
				}
				return num;
			}

			// Token: 0x060003F3 RID: 1011 RVA: 0x00019980 File Offset: 0x00017B80
			public int ToArrayNonAlloc<TState, T>(Func<GameObject, TState> let, Func<TState, bool> filter, Func<TState, T> selector, ref T[] array)
			{
				int num = 0;
				foreach (GameObject arg in this)
				{
					TState arg2 = let(arg);
					if (filter(arg2))
					{
						if (array.Length == num)
						{
							int newSize = (num != 0) ? (num * 2) : this.GetChildrenSize();
							Array.Resize<T>(ref array, newSize);
						}
						array[num++] = selector(arg2);
					}
				}
				return num;
			}

			// Token: 0x060003F4 RID: 1012 RVA: 0x00019A08 File Offset: 0x00017C08
			public GameObject[] ToArray()
			{
				GameObject[] array = new GameObject[this.GetChildrenSize()];
				int num = this.ToArrayNonAlloc(ref array);
				if (array.Length != num)
				{
					Array.Resize<GameObject>(ref array, num);
				}
				return array;
			}

			// Token: 0x060003F5 RID: 1013 RVA: 0x00019A3C File Offset: 0x00017C3C
			public GameObject[] ToArray(Func<GameObject, bool> filter)
			{
				GameObject[] array = new GameObject[this.GetChildrenSize()];
				int num = this.ToArrayNonAlloc(filter, ref array);
				if (array.Length != num)
				{
					Array.Resize<GameObject>(ref array, num);
				}
				return array;
			}

			// Token: 0x060003F6 RID: 1014 RVA: 0x00019A74 File Offset: 0x00017C74
			public T[] ToArray<T>(Func<GameObject, T> selector)
			{
				T[] array = new T[this.GetChildrenSize()];
				int num = this.ToArrayNonAlloc<T>(selector, ref array);
				if (array.Length != num)
				{
					Array.Resize<T>(ref array, num);
				}
				return array;
			}

			// Token: 0x060003F7 RID: 1015 RVA: 0x00019AAC File Offset: 0x00017CAC
			public T[] ToArray<T>(Func<GameObject, bool> filter, Func<GameObject, T> selector)
			{
				T[] array = new T[this.GetChildrenSize()];
				int num = this.ToArrayNonAlloc<T>(filter, selector, ref array);
				if (array.Length != num)
				{
					Array.Resize<T>(ref array, num);
				}
				return array;
			}

			// Token: 0x060003F8 RID: 1016 RVA: 0x00019AE4 File Offset: 0x00017CE4
			public T[] ToArray<TState, T>(Func<GameObject, TState> let, Func<TState, bool> filter, Func<TState, T> selector)
			{
				T[] array = new T[this.GetChildrenSize()];
				int num = this.ToArrayNonAlloc<TState, T>(let, filter, selector, ref array);
				if (array.Length != num)
				{
					Array.Resize<T>(ref array, num);
				}
				return array;
			}

			// Token: 0x060003F9 RID: 1017 RVA: 0x00019B1C File Offset: 0x00017D1C
			public GameObject First()
			{
				GameObjectExtensions.ChildrenEnumerable.Enumerator enumerator = this.GetEnumerator();
				if (enumerator.MoveNext())
				{
					return enumerator.Current;
				}
				throw new InvalidOperationException("sequence is empty.");
			}

			// Token: 0x060003FA RID: 1018 RVA: 0x00019B50 File Offset: 0x00017D50
			public GameObject FirstOrDefault()
			{
				GameObjectExtensions.ChildrenEnumerable.Enumerator enumerator = this.GetEnumerator();
				return (!enumerator.MoveNext()) ? null : enumerator.Current;
			}

			// Token: 0x04000360 RID: 864
			private readonly GameObject origin;

			// Token: 0x04000361 RID: 865
			private readonly bool withSelf;

			// Token: 0x0200007B RID: 123
			public struct Enumerator : IEnumerator<GameObject>, IEnumerator, IDisposable
			{
				// Token: 0x060003FB RID: 1019 RVA: 0x00019B80 File Offset: 0x00017D80
				internal Enumerator(Transform originTransform, bool withSelf, bool canRun)
				{
					this.originTransform = originTransform;
					this.withSelf = withSelf;
					this.childCount = ((!canRun) ? 0 : originTransform.childCount);
					this.currentIndex = -1;
					this.canRun = canRun;
					this.current = null;
				}

				// Token: 0x060003FC RID: 1020 RVA: 0x00019BC0 File Offset: 0x00017DC0
				public bool MoveNext()
				{
					if (!this.canRun)
					{
						return false;
					}
					if (this.withSelf)
					{
						this.current = this.originTransform.gameObject;
						this.withSelf = false;
						return true;
					}
					this.currentIndex++;
					if (this.currentIndex < this.childCount)
					{
						Transform child = this.originTransform.GetChild(this.currentIndex);
						this.current = child.gameObject;
						return true;
					}
					return false;
				}

				// Token: 0x17000044 RID: 68
				// (get) Token: 0x060003FD RID: 1021 RVA: 0x00019C40 File Offset: 0x00017E40
				public GameObject Current
				{
					get
					{
						return this.current;
					}
				}

				// Token: 0x17000043 RID: 67
				// (get) Token: 0x060003FE RID: 1022 RVA: 0x00019C48 File Offset: 0x00017E48
				object IEnumerator.Current
				{
					get
					{
						return this.current;
					}
				}

				// Token: 0x060003FF RID: 1023 RVA: 0x00019C50 File Offset: 0x00017E50
				public void Dispose()
				{
				}

				// Token: 0x06000400 RID: 1024 RVA: 0x00019C54 File Offset: 0x00017E54
				public void Reset()
				{
					throw new NotSupportedException();
				}

				// Token: 0x04000362 RID: 866
				private readonly int childCount;

				// Token: 0x04000363 RID: 867
				private readonly Transform originTransform;

				// Token: 0x04000364 RID: 868
				private readonly bool canRun;

				// Token: 0x04000365 RID: 869
				private bool withSelf;

				// Token: 0x04000366 RID: 870
				private int currentIndex;

				// Token: 0x04000367 RID: 871
				private GameObject current;
			}

			// Token: 0x0200007C RID: 124
			public struct OfComponentEnumerable<T> : IEnumerable<T>, IEnumerable where T : Component
			{
				// Token: 0x06000401 RID: 1025 RVA: 0x00019C5C File Offset: 0x00017E5C
				public OfComponentEnumerable(ref GameObjectExtensions.ChildrenEnumerable parent)
				{
					this.parent = parent;
				}

				// Token: 0x06000402 RID: 1026 RVA: 0x00019C6C File Offset: 0x00017E6C
				public GameObjectExtensions.ChildrenEnumerable.OfComponentEnumerator<T> GetEnumerator()
				{
					return new GameObjectExtensions.ChildrenEnumerable.OfComponentEnumerator<T>(ref this.parent);
				}

				// Token: 0x06000403 RID: 1027 RVA: 0x00019C7C File Offset: 0x00017E7C
				IEnumerator<T> IEnumerable<T>.GetEnumerator()
				{
					return this.GetEnumerator();
				}

				// Token: 0x06000404 RID: 1028 RVA: 0x00019C8C File Offset: 0x00017E8C
				IEnumerator IEnumerable.GetEnumerator()
				{
					return this.GetEnumerator();
				}

				// Token: 0x06000405 RID: 1029 RVA: 0x00019C9C File Offset: 0x00017E9C
				public void ForEach(Action<T> action)
				{
					foreach (T obj in this)
					{
						action(obj);
					}
				}

				// Token: 0x06000406 RID: 1030 RVA: 0x00019CD0 File Offset: 0x00017ED0
				public T First()
				{
					GameObjectExtensions.ChildrenEnumerable.OfComponentEnumerator<T> enumerator = this.GetEnumerator();
					if (enumerator.MoveNext())
					{
						return enumerator.Current;
					}
					throw new InvalidOperationException("sequence is empty.");
				}

				// Token: 0x06000407 RID: 1031 RVA: 0x00019D04 File Offset: 0x00017F04
				public T FirstOrDefault()
				{
					GameObjectExtensions.ChildrenEnumerable.OfComponentEnumerator<T> enumerator = this.GetEnumerator();
					return (!enumerator.MoveNext()) ? ((T)((object)null)) : enumerator.Current;
				}

				// Token: 0x06000408 RID: 1032 RVA: 0x00019D38 File Offset: 0x00017F38
				public T[] ToArray()
				{
					T[] array = new T[this.parent.GetChildrenSize()];
					int num = this.ToArrayNonAlloc(ref array);
					if (array.Length != num)
					{
						Array.Resize<T>(ref array, num);
					}
					return array;
				}

				// Token: 0x06000409 RID: 1033 RVA: 0x00019D74 File Offset: 0x00017F74
				public int ToArrayNonAlloc(ref T[] array)
				{
					int num = 0;
					GameObjectExtensions.ChildrenEnumerable.OfComponentEnumerator<T> enumerator = this.GetEnumerator();
					while (enumerator.MoveNext())
					{
						if (array.Length == num)
						{
							int newSize = (num != 0) ? (num * 2) : this.parent.GetChildrenSize();
							Array.Resize<T>(ref array, newSize);
						}
						array[num++] = enumerator.Current;
					}
					return num;
				}

				// Token: 0x04000368 RID: 872
				private GameObjectExtensions.ChildrenEnumerable parent;
			}

			// Token: 0x0200007D RID: 125
			public struct OfComponentEnumerator<T> : IEnumerator<T>, IEnumerator, IDisposable where T : Component
			{
				// Token: 0x0600040A RID: 1034 RVA: 0x00019DDC File Offset: 0x00017FDC
				public OfComponentEnumerator(ref GameObjectExtensions.ChildrenEnumerable parent)
				{
					this.enumerator = parent.GetEnumerator();
					this.current = (T)((object)null);
				}

				// Token: 0x0600040B RID: 1035 RVA: 0x00019DF8 File Offset: 0x00017FF8
				public bool MoveNext()
				{
					while (this.enumerator.MoveNext())
					{
						T component = this.enumerator.Current.GetComponent<T>();
						if (component != null)
						{
							this.current = component;
							return true;
						}
					}
					return false;
				}

				// Token: 0x17000046 RID: 70
				// (get) Token: 0x0600040C RID: 1036 RVA: 0x00019E48 File Offset: 0x00018048
				public T Current
				{
					get
					{
						return this.current;
					}
				}

				// Token: 0x17000045 RID: 69
				// (get) Token: 0x0600040D RID: 1037 RVA: 0x00019E50 File Offset: 0x00018050
				object IEnumerator.Current
				{
					get
					{
						return this.current;
					}
				}

				// Token: 0x0600040E RID: 1038 RVA: 0x00019E60 File Offset: 0x00018060
				public void Dispose()
				{
				}

				// Token: 0x0600040F RID: 1039 RVA: 0x00019E64 File Offset: 0x00018064
				public void Reset()
				{
					throw new NotSupportedException();
				}

				// Token: 0x04000369 RID: 873
				private GameObjectExtensions.ChildrenEnumerable.Enumerator enumerator;

				// Token: 0x0400036A RID: 874
				private T current;
			}
		}

		// Token: 0x0200007E RID: 126
		public struct AncestorsEnumerable : IEnumerable<GameObject>, IEnumerable
		{
			// Token: 0x06000410 RID: 1040 RVA: 0x00019E6C File Offset: 0x0001806C
			public AncestorsEnumerable(GameObject origin, bool withSelf)
			{
				this.origin = origin;
				this.withSelf = withSelf;
			}

			// Token: 0x06000411 RID: 1041 RVA: 0x00019E7C File Offset: 0x0001807C
			public GameObjectExtensions.AncestorsEnumerable.OfComponentEnumerable<T> OfComponent<T>() where T : Component
			{
				return new GameObjectExtensions.AncestorsEnumerable.OfComponentEnumerable<T>(ref this);
			}

			// Token: 0x06000412 RID: 1042 RVA: 0x00019E84 File Offset: 0x00018084
			public void Destroy(bool useDestroyImmediate = false)
			{
				foreach (GameObject self in this)
				{
					self.Destroy(useDestroyImmediate, false);
				}
			}

			// Token: 0x06000413 RID: 1043 RVA: 0x00019EB8 File Offset: 0x000180B8
			public void Destroy(Func<GameObject, bool> predicate, bool useDestroyImmediate = false)
			{
				foreach (GameObject gameObject in this)
				{
					if (predicate(gameObject))
					{
						gameObject.Destroy(useDestroyImmediate, false);
					}
				}
			}

			// Token: 0x06000414 RID: 1044 RVA: 0x00019EFC File Offset: 0x000180FC
			public GameObjectExtensions.AncestorsEnumerable.Enumerator GetEnumerator()
			{
				return (!(this.origin == null)) ? new GameObjectExtensions.AncestorsEnumerable.Enumerator(this.origin, this.origin.transform, this.withSelf, true) : new GameObjectExtensions.AncestorsEnumerable.Enumerator(null, null, this.withSelf, false);
			}

			// Token: 0x06000415 RID: 1045 RVA: 0x00019F4C File Offset: 0x0001814C
			IEnumerator<GameObject> IEnumerable<GameObject>.GetEnumerator()
			{
				return this.GetEnumerator();
			}

			// Token: 0x06000416 RID: 1046 RVA: 0x00019F5C File Offset: 0x0001815C
			IEnumerator IEnumerable.GetEnumerator()
			{
				return this.GetEnumerator();
			}

			// Token: 0x06000417 RID: 1047 RVA: 0x00019F6C File Offset: 0x0001816C
			public void ForEach(Action<GameObject> action)
			{
				foreach (GameObject obj in this)
				{
					action(obj);
				}
			}

			// Token: 0x06000418 RID: 1048 RVA: 0x00019FA0 File Offset: 0x000181A0
			public int ToArrayNonAlloc(ref GameObject[] array)
			{
				int num = 0;
				foreach (GameObject gameObject in this)
				{
					if (array.Length == num)
					{
						int newSize = (num != 0) ? (num * 2) : 4;
						Array.Resize<GameObject>(ref array, newSize);
					}
					array[num++] = gameObject;
				}
				return num;
			}

			// Token: 0x06000419 RID: 1049 RVA: 0x00019FFC File Offset: 0x000181FC
			public int ToArrayNonAlloc(Func<GameObject, bool> filter, ref GameObject[] array)
			{
				int num = 0;
				foreach (GameObject gameObject in this)
				{
					if (filter(gameObject))
					{
						if (array.Length == num)
						{
							int newSize = (num != 0) ? (num * 2) : 4;
							Array.Resize<GameObject>(ref array, newSize);
						}
						array[num++] = gameObject;
					}
				}
				return num;
			}

			// Token: 0x0600041A RID: 1050 RVA: 0x0001A068 File Offset: 0x00018268
			public int ToArrayNonAlloc<T>(Func<GameObject, T> selector, ref T[] array)
			{
				int num = 0;
				foreach (GameObject arg in this)
				{
					if (array.Length == num)
					{
						int newSize = (num != 0) ? (num * 2) : 4;
						Array.Resize<T>(ref array, newSize);
					}
					array[num++] = selector(arg);
				}
				return num;
			}

			// Token: 0x0600041B RID: 1051 RVA: 0x0001A0CC File Offset: 0x000182CC
			public int ToArrayNonAlloc<T>(Func<GameObject, bool> filter, Func<GameObject, T> selector, ref T[] array)
			{
				int num = 0;
				foreach (GameObject arg in this)
				{
					if (filter(arg))
					{
						if (array.Length == num)
						{
							int newSize = (num != 0) ? (num * 2) : 4;
							Array.Resize<T>(ref array, newSize);
						}
						array[num++] = selector(arg);
					}
				}
				return num;
			}

			// Token: 0x0600041C RID: 1052 RVA: 0x0001A144 File Offset: 0x00018344
			public int ToArrayNonAlloc<TState, T>(Func<GameObject, TState> let, Func<TState, bool> filter, Func<TState, T> selector, ref T[] array)
			{
				int num = 0;
				foreach (GameObject arg in this)
				{
					TState arg2 = let(arg);
					if (filter(arg2))
					{
						if (array.Length == num)
						{
							int newSize = (num != 0) ? (num * 2) : 4;
							Array.Resize<T>(ref array, newSize);
						}
						array[num++] = selector(arg2);
					}
				}
				return num;
			}

			// Token: 0x0600041D RID: 1053 RVA: 0x0001A1C8 File Offset: 0x000183C8
			public GameObject[] ToArray()
			{
				GameObject[] array = new GameObject[4];
				int num = this.ToArrayNonAlloc(ref array);
				if (array.Length != num)
				{
					Array.Resize<GameObject>(ref array, num);
				}
				return array;
			}

			// Token: 0x0600041E RID: 1054 RVA: 0x0001A1F8 File Offset: 0x000183F8
			public GameObject[] ToArray(Func<GameObject, bool> filter)
			{
				GameObject[] array = new GameObject[4];
				int num = this.ToArrayNonAlloc(filter, ref array);
				if (array.Length != num)
				{
					Array.Resize<GameObject>(ref array, num);
				}
				return array;
			}

			// Token: 0x0600041F RID: 1055 RVA: 0x0001A228 File Offset: 0x00018428
			public T[] ToArray<T>(Func<GameObject, T> selector)
			{
				T[] array = new T[4];
				int num = this.ToArrayNonAlloc<T>(selector, ref array);
				if (array.Length != num)
				{
					Array.Resize<T>(ref array, num);
				}
				return array;
			}

			// Token: 0x06000420 RID: 1056 RVA: 0x0001A258 File Offset: 0x00018458
			public T[] ToArray<T>(Func<GameObject, bool> filter, Func<GameObject, T> selector)
			{
				T[] array = new T[4];
				int num = this.ToArrayNonAlloc<T>(filter, selector, ref array);
				if (array.Length != num)
				{
					Array.Resize<T>(ref array, num);
				}
				return array;
			}

			// Token: 0x06000421 RID: 1057 RVA: 0x0001A28C File Offset: 0x0001848C
			public T[] ToArray<TState, T>(Func<GameObject, TState> let, Func<TState, bool> filter, Func<TState, T> selector)
			{
				T[] array = new T[4];
				int num = this.ToArrayNonAlloc<TState, T>(let, filter, selector, ref array);
				if (array.Length != num)
				{
					Array.Resize<T>(ref array, num);
				}
				return array;
			}

			// Token: 0x06000422 RID: 1058 RVA: 0x0001A2C0 File Offset: 0x000184C0
			public GameObject First()
			{
				GameObjectExtensions.AncestorsEnumerable.Enumerator enumerator = this.GetEnumerator();
				if (enumerator.MoveNext())
				{
					return enumerator.Current;
				}
				throw new InvalidOperationException("sequence is empty.");
			}

			// Token: 0x06000423 RID: 1059 RVA: 0x0001A2F4 File Offset: 0x000184F4
			public GameObject FirstOrDefault()
			{
				GameObjectExtensions.AncestorsEnumerable.Enumerator enumerator = this.GetEnumerator();
				return (!enumerator.MoveNext()) ? null : enumerator.Current;
			}

			// Token: 0x0400036B RID: 875
			private readonly GameObject origin;

			// Token: 0x0400036C RID: 876
			private readonly bool withSelf;

			// Token: 0x0200007F RID: 127
			public struct Enumerator : IEnumerator<GameObject>, IEnumerator, IDisposable
			{
				// Token: 0x06000424 RID: 1060 RVA: 0x0001A324 File Offset: 0x00018524
				internal Enumerator(GameObject origin, Transform originTransform, bool withSelf, bool canRun)
				{
					this.current = origin;
					this.currentTransform = originTransform;
					this.withSelf = withSelf;
					this.canRun = canRun;
				}

				// Token: 0x06000425 RID: 1061 RVA: 0x0001A344 File Offset: 0x00018544
				public bool MoveNext()
				{
					if (!this.canRun)
					{
						return false;
					}
					if (this.withSelf)
					{
						this.withSelf = false;
						return true;
					}
					Transform parent = this.currentTransform.parent;
					if (parent != null)
					{
						this.current = parent.gameObject;
						this.currentTransform = parent;
						return true;
					}
					return false;
				}

				// Token: 0x17000048 RID: 72
				// (get) Token: 0x06000426 RID: 1062 RVA: 0x0001A3A0 File Offset: 0x000185A0
				public GameObject Current
				{
					get
					{
						return this.current;
					}
				}

				// Token: 0x17000047 RID: 71
				// (get) Token: 0x06000427 RID: 1063 RVA: 0x0001A3A8 File Offset: 0x000185A8
				object IEnumerator.Current
				{
					get
					{
						return this.current;
					}
				}

				// Token: 0x06000428 RID: 1064 RVA: 0x0001A3B0 File Offset: 0x000185B0
				public void Dispose()
				{
				}

				// Token: 0x06000429 RID: 1065 RVA: 0x0001A3B4 File Offset: 0x000185B4
				public void Reset()
				{
					throw new NotSupportedException();
				}

				// Token: 0x0400036D RID: 877
				private readonly bool canRun;

				// Token: 0x0400036E RID: 878
				private GameObject current;

				// Token: 0x0400036F RID: 879
				private Transform currentTransform;

				// Token: 0x04000370 RID: 880
				private bool withSelf;
			}

			// Token: 0x02000080 RID: 128
			public struct OfComponentEnumerable<T> : IEnumerable<T>, IEnumerable where T : Component
			{
				// Token: 0x0600042A RID: 1066 RVA: 0x0001A3BC File Offset: 0x000185BC
				public OfComponentEnumerable(ref GameObjectExtensions.AncestorsEnumerable parent)
				{
					this.parent = parent;
				}

				// Token: 0x0600042B RID: 1067 RVA: 0x0001A3CC File Offset: 0x000185CC
				public GameObjectExtensions.AncestorsEnumerable.OfComponentEnumerator<T> GetEnumerator()
				{
					return new GameObjectExtensions.AncestorsEnumerable.OfComponentEnumerator<T>(ref this.parent);
				}

				// Token: 0x0600042C RID: 1068 RVA: 0x0001A3DC File Offset: 0x000185DC
				IEnumerator<T> IEnumerable<T>.GetEnumerator()
				{
					return this.GetEnumerator();
				}

				// Token: 0x0600042D RID: 1069 RVA: 0x0001A3EC File Offset: 0x000185EC
				IEnumerator IEnumerable.GetEnumerator()
				{
					return this.GetEnumerator();
				}

				// Token: 0x0600042E RID: 1070 RVA: 0x0001A3FC File Offset: 0x000185FC
				public void ForEach(Action<T> action)
				{
					foreach (T obj in this)
					{
						action(obj);
					}
				}

				// Token: 0x0600042F RID: 1071 RVA: 0x0001A430 File Offset: 0x00018630
				public T First()
				{
					GameObjectExtensions.AncestorsEnumerable.OfComponentEnumerator<T> enumerator = this.GetEnumerator();
					if (enumerator.MoveNext())
					{
						return enumerator.Current;
					}
					throw new InvalidOperationException("sequence is empty.");
				}

				// Token: 0x06000430 RID: 1072 RVA: 0x0001A464 File Offset: 0x00018664
				public T FirstOrDefault()
				{
					GameObjectExtensions.AncestorsEnumerable.OfComponentEnumerator<T> enumerator = this.GetEnumerator();
					return (!enumerator.MoveNext()) ? ((T)((object)null)) : enumerator.Current;
				}

				// Token: 0x06000431 RID: 1073 RVA: 0x0001A498 File Offset: 0x00018698
				public T[] ToArray()
				{
					T[] array = new T[4];
					int num = this.ToArrayNonAlloc(ref array);
					if (array.Length != num)
					{
						Array.Resize<T>(ref array, num);
					}
					return array;
				}

				// Token: 0x06000432 RID: 1074 RVA: 0x0001A4C8 File Offset: 0x000186C8
				public int ToArrayNonAlloc(ref T[] array)
				{
					int num = 0;
					GameObjectExtensions.AncestorsEnumerable.OfComponentEnumerator<T> enumerator = this.GetEnumerator();
					while (enumerator.MoveNext())
					{
						if (array.Length == num)
						{
							int newSize = (num != 0) ? (num * 2) : 4;
							Array.Resize<T>(ref array, newSize);
						}
						array[num++] = enumerator.Current;
					}
					return num;
				}

				// Token: 0x04000371 RID: 881
				private GameObjectExtensions.AncestorsEnumerable parent;
			}

			// Token: 0x02000081 RID: 129
			public struct OfComponentEnumerator<T> : IEnumerator<T>, IEnumerator, IDisposable where T : Component
			{
				// Token: 0x06000433 RID: 1075 RVA: 0x0001A524 File Offset: 0x00018724
				public OfComponentEnumerator(ref GameObjectExtensions.AncestorsEnumerable parent)
				{
					this.enumerator = parent.GetEnumerator();
					this.current = (T)((object)null);
				}

				// Token: 0x06000434 RID: 1076 RVA: 0x0001A540 File Offset: 0x00018740
				public bool MoveNext()
				{
					while (this.enumerator.MoveNext())
					{
						T component = this.enumerator.Current.GetComponent<T>();
						if (component != null)
						{
							this.current = component;
							return true;
						}
					}
					return false;
				}

				// Token: 0x1700004A RID: 74
				// (get) Token: 0x06000435 RID: 1077 RVA: 0x0001A590 File Offset: 0x00018790
				public T Current
				{
					get
					{
						return this.current;
					}
				}

				// Token: 0x17000049 RID: 73
				// (get) Token: 0x06000436 RID: 1078 RVA: 0x0001A598 File Offset: 0x00018798
				object IEnumerator.Current
				{
					get
					{
						return this.current;
					}
				}

				// Token: 0x06000437 RID: 1079 RVA: 0x0001A5A8 File Offset: 0x000187A8
				public void Dispose()
				{
				}

				// Token: 0x06000438 RID: 1080 RVA: 0x0001A5AC File Offset: 0x000187AC
				public void Reset()
				{
					throw new NotSupportedException();
				}

				// Token: 0x04000372 RID: 882
				private GameObjectExtensions.AncestorsEnumerable.Enumerator enumerator;

				// Token: 0x04000373 RID: 883
				private T current;
			}
		}

		// Token: 0x02000082 RID: 130
		public struct DescendantsEnumerable : IEnumerable<GameObject>, IEnumerable
		{
			// Token: 0x06000439 RID: 1081 RVA: 0x0001A5B4 File Offset: 0x000187B4
			public DescendantsEnumerable(GameObject origin, bool withSelf, Func<Transform, bool> descendIntoChildren)
			{
				this.origin = origin;
				this.withSelf = withSelf;
				this.descendIntoChildren = (descendIntoChildren ?? GameObjectExtensions.DescendantsEnumerable.alwaysTrue);
			}

			// Token: 0x0600043A RID: 1082 RVA: 0x0001A5D8 File Offset: 0x000187D8
			public GameObjectExtensions.DescendantsEnumerable.OfComponentEnumerable<T> OfComponent<T>() where T : Component
			{
				return new GameObjectExtensions.DescendantsEnumerable.OfComponentEnumerable<T>(ref this);
			}

			// Token: 0x0600043B RID: 1083 RVA: 0x0001A5E0 File Offset: 0x000187E0
			public void Destroy(bool useDestroyImmediate = false)
			{
				foreach (GameObject self in this)
				{
					self.Destroy(useDestroyImmediate, false);
				}
			}

			// Token: 0x0600043C RID: 1084 RVA: 0x0001A614 File Offset: 0x00018814
			public void Destroy(Func<GameObject, bool> predicate, bool useDestroyImmediate = false)
			{
				foreach (GameObject gameObject in this)
				{
					if (predicate(gameObject))
					{
						gameObject.Destroy(useDestroyImmediate, false);
					}
				}
			}

			// Token: 0x0600043D RID: 1085 RVA: 0x0001A658 File Offset: 0x00018858
			public GameObjectExtensions.DescendantsEnumerable.Enumerator GetEnumerator()
			{
				if (this.origin == null)
				{
					return new GameObjectExtensions.DescendantsEnumerable.Enumerator(null, this.withSelf, false, null, this.descendIntoChildren);
				}
				GameObjectExtensions.DescendantsEnumerable.InternalUnsafeRefStack internalUnsafeRefStack;
				if (GameObjectExtensions.DescendantsEnumerable.InternalUnsafeRefStack.RefStackPool.Count != 0)
				{
					internalUnsafeRefStack = GameObjectExtensions.DescendantsEnumerable.InternalUnsafeRefStack.RefStackPool.Dequeue();
					internalUnsafeRefStack.Reset();
				}
				else
				{
					internalUnsafeRefStack = new GameObjectExtensions.DescendantsEnumerable.InternalUnsafeRefStack(6);
				}
				return new GameObjectExtensions.DescendantsEnumerable.Enumerator(this.origin.transform, this.withSelf, true, internalUnsafeRefStack, this.descendIntoChildren);
			}

			// Token: 0x0600043E RID: 1086 RVA: 0x0001A6D8 File Offset: 0x000188D8
			IEnumerator<GameObject> IEnumerable<GameObject>.GetEnumerator()
			{
				return this.GetEnumerator();
			}

			// Token: 0x0600043F RID: 1087 RVA: 0x0001A6E8 File Offset: 0x000188E8
			IEnumerator IEnumerable.GetEnumerator()
			{
				return this.GetEnumerator();
			}

			// Token: 0x06000440 RID: 1088 RVA: 0x0001A6F8 File Offset: 0x000188F8
			private void ResizeArray<T>(ref int index, ref T[] array)
			{
				if (array.Length == index)
				{
					int newSize = (index != 0) ? (index * 2) : 4;
					Array.Resize<T>(ref array, newSize);
				}
			}

			// Token: 0x06000441 RID: 1089 RVA: 0x0001A72C File Offset: 0x0001892C
			private void DescendantsCore(ref Transform transform, ref Action<GameObject> action)
			{
				if (!this.descendIntoChildren(transform))
				{
					return;
				}
				int childCount = transform.childCount;
				for (int i = 0; i < childCount; i++)
				{
					Transform child = transform.GetChild(i);
					action(child.gameObject);
					this.DescendantsCore(ref child, ref action);
				}
			}

			// Token: 0x06000442 RID: 1090 RVA: 0x0001A788 File Offset: 0x00018988
			private void DescendantsCore(ref Transform transform, ref int index, ref GameObject[] array)
			{
				if (!this.descendIntoChildren(transform))
				{
					return;
				}
				int childCount = transform.childCount;
				for (int i = 0; i < childCount; i++)
				{
					Transform child = transform.GetChild(i);
					this.ResizeArray<GameObject>(ref index, ref array);
					array[index++] = child.gameObject;
					this.DescendantsCore(ref child, ref index, ref array);
				}
			}

			// Token: 0x06000443 RID: 1091 RVA: 0x0001A7F0 File Offset: 0x000189F0
			private void DescendantsCore(ref Func<GameObject, bool> filter, ref Transform transform, ref int index, ref GameObject[] array)
			{
				if (!this.descendIntoChildren(transform))
				{
					return;
				}
				int childCount = transform.childCount;
				for (int i = 0; i < childCount; i++)
				{
					Transform child = transform.GetChild(i);
					GameObject gameObject = child.gameObject;
					if (filter(gameObject))
					{
						this.ResizeArray<GameObject>(ref index, ref array);
						array[index++] = gameObject;
					}
					this.DescendantsCore(ref filter, ref child, ref index, ref array);
				}
			}

			// Token: 0x06000444 RID: 1092 RVA: 0x0001A86C File Offset: 0x00018A6C
			private void DescendantsCore<T>(ref Func<GameObject, T> selector, ref Transform transform, ref int index, ref T[] array)
			{
				if (!this.descendIntoChildren(transform))
				{
					return;
				}
				int childCount = transform.childCount;
				for (int i = 0; i < childCount; i++)
				{
					Transform child = transform.GetChild(i);
					this.ResizeArray<T>(ref index, ref array);
					array[index++] = selector(child.gameObject);
					this.DescendantsCore<T>(ref selector, ref child, ref index, ref array);
				}
			}

			// Token: 0x06000445 RID: 1093 RVA: 0x0001A8E4 File Offset: 0x00018AE4
			private void DescendantsCore<T>(ref Func<GameObject, bool> filter, ref Func<GameObject, T> selector, ref Transform transform, ref int index, ref T[] array)
			{
				if (!this.descendIntoChildren(transform))
				{
					return;
				}
				int childCount = transform.childCount;
				for (int i = 0; i < childCount; i++)
				{
					Transform child = transform.GetChild(i);
					GameObject gameObject = child.gameObject;
					if (filter(gameObject))
					{
						this.ResizeArray<T>(ref index, ref array);
						array[index++] = selector(gameObject);
					}
					this.DescendantsCore<T>(ref filter, ref selector, ref child, ref index, ref array);
				}
			}

			// Token: 0x06000446 RID: 1094 RVA: 0x0001A970 File Offset: 0x00018B70
			private void DescendantsCore<TState, T>(ref Func<GameObject, TState> let, ref Func<TState, bool> filter, ref Func<TState, T> selector, ref Transform transform, ref int index, ref T[] array)
			{
				if (!this.descendIntoChildren(transform))
				{
					return;
				}
				int childCount = transform.childCount;
				for (int i = 0; i < childCount; i++)
				{
					Transform child = transform.GetChild(i);
					TState arg = let(child.gameObject);
					if (filter(arg))
					{
						this.ResizeArray<T>(ref index, ref array);
						array[index++] = selector(arg);
					}
					this.DescendantsCore<TState, T>(ref let, ref filter, ref selector, ref child, ref index, ref array);
				}
			}

			// Token: 0x06000447 RID: 1095 RVA: 0x0001AA08 File Offset: 0x00018C08
			public void ForEach(Action<GameObject> action)
			{
				if (this.withSelf)
				{
					action(this.origin);
				}
				Transform transform = this.origin.transform;
				this.DescendantsCore(ref transform, ref action);
			}

			// Token: 0x06000448 RID: 1096 RVA: 0x0001AA44 File Offset: 0x00018C44
			public int ToArrayNonAlloc(ref GameObject[] array)
			{
				int result = 0;
				if (this.withSelf)
				{
					this.ResizeArray<GameObject>(ref result, ref array);
					array[result++] = this.origin;
				}
				Transform transform = this.origin.transform;
				this.DescendantsCore(ref transform, ref result, ref array);
				return result;
			}

			// Token: 0x06000449 RID: 1097 RVA: 0x0001AA90 File Offset: 0x00018C90
			public int ToArrayNonAlloc(Func<GameObject, bool> filter, ref GameObject[] array)
			{
				int result = 0;
				if (this.withSelf && filter(this.origin))
				{
					this.ResizeArray<GameObject>(ref result, ref array);
					array[result++] = this.origin;
				}
				Transform transform = this.origin.transform;
				this.DescendantsCore(ref filter, ref transform, ref result, ref array);
				return result;
			}

			// Token: 0x0600044A RID: 1098 RVA: 0x0001AAEC File Offset: 0x00018CEC
			public int ToArrayNonAlloc<T>(Func<GameObject, T> selector, ref T[] array)
			{
				int result = 0;
				if (this.withSelf)
				{
					this.ResizeArray<T>(ref result, ref array);
					array[result++] = selector(this.origin);
				}
				Transform transform = this.origin.transform;
				this.DescendantsCore<T>(ref selector, ref transform, ref result, ref array);
				return result;
			}

			// Token: 0x0600044B RID: 1099 RVA: 0x0001AB44 File Offset: 0x00018D44
			public int ToArrayNonAlloc<T>(Func<GameObject, bool> filter, Func<GameObject, T> selector, ref T[] array)
			{
				int result = 0;
				if (this.withSelf && filter(this.origin))
				{
					this.ResizeArray<T>(ref result, ref array);
					array[result++] = selector(this.origin);
				}
				Transform transform = this.origin.transform;
				this.DescendantsCore<T>(ref filter, ref selector, ref transform, ref result, ref array);
				return result;
			}

			// Token: 0x0600044C RID: 1100 RVA: 0x0001ABAC File Offset: 0x00018DAC
			public int ToArrayNonAlloc<TState, T>(Func<GameObject, TState> let, Func<TState, bool> filter, Func<TState, T> selector, ref T[] array)
			{
				int result = 0;
				if (this.withSelf)
				{
					TState arg = let(this.origin);
					if (filter(arg))
					{
						this.ResizeArray<T>(ref result, ref array);
						array[result++] = selector(arg);
					}
				}
				Transform transform = this.origin.transform;
				this.DescendantsCore<TState, T>(ref let, ref filter, ref selector, ref transform, ref result, ref array);
				return result;
			}

			// Token: 0x0600044D RID: 1101 RVA: 0x0001AC1C File Offset: 0x00018E1C
			public GameObject[] ToArray()
			{
				GameObject[] array = new GameObject[4];
				int num = this.ToArrayNonAlloc(ref array);
				if (array.Length != num)
				{
					Array.Resize<GameObject>(ref array, num);
				}
				return array;
			}

			// Token: 0x0600044E RID: 1102 RVA: 0x0001AC4C File Offset: 0x00018E4C
			public GameObject[] ToArray(Func<GameObject, bool> filter)
			{
				GameObject[] array = new GameObject[4];
				int num = this.ToArrayNonAlloc(filter, ref array);
				if (array.Length != num)
				{
					Array.Resize<GameObject>(ref array, num);
				}
				return array;
			}

			// Token: 0x0600044F RID: 1103 RVA: 0x0001AC7C File Offset: 0x00018E7C
			public T[] ToArray<T>(Func<GameObject, T> selector)
			{
				T[] array = new T[4];
				int num = this.ToArrayNonAlloc<T>(selector, ref array);
				if (array.Length != num)
				{
					Array.Resize<T>(ref array, num);
				}
				return array;
			}

			// Token: 0x06000450 RID: 1104 RVA: 0x0001ACAC File Offset: 0x00018EAC
			public T[] ToArray<T>(Func<GameObject, bool> filter, Func<GameObject, T> selector)
			{
				T[] array = new T[4];
				int num = this.ToArrayNonAlloc<T>(filter, selector, ref array);
				if (array.Length != num)
				{
					Array.Resize<T>(ref array, num);
				}
				return array;
			}

			// Token: 0x06000451 RID: 1105 RVA: 0x0001ACE0 File Offset: 0x00018EE0
			public T[] ToArray<TState, T>(Func<GameObject, TState> let, Func<TState, bool> filter, Func<TState, T> selector)
			{
				T[] array = new T[4];
				int num = this.ToArrayNonAlloc<TState, T>(let, filter, selector, ref array);
				if (array.Length != num)
				{
					Array.Resize<T>(ref array, num);
				}
				return array;
			}

			// Token: 0x06000452 RID: 1106 RVA: 0x0001AD14 File Offset: 0x00018F14
			public GameObject First()
			{
				GameObject result;
				using (GameObjectExtensions.DescendantsEnumerable.Enumerator enumerator = this.GetEnumerator())
				{
					if (!enumerator.MoveNext())
					{
						throw new InvalidOperationException("sequence is empty.");
					}
					result = enumerator.Current;
				}
				return result;
			}

			// Token: 0x06000453 RID: 1107 RVA: 0x0001AD68 File Offset: 0x00018F68
			public GameObject FirstOrDefault()
			{
				GameObject result;
				using (GameObjectExtensions.DescendantsEnumerable.Enumerator enumerator = this.GetEnumerator())
				{
					result = ((!enumerator.MoveNext()) ? null : enumerator.Current);
				}
				return result;
			}

			// Token: 0x04000374 RID: 884
			private static readonly Func<Transform, bool> alwaysTrue = (Transform _) => true;

			// Token: 0x04000375 RID: 885
			private readonly GameObject origin;

			// Token: 0x04000376 RID: 886
			private readonly bool withSelf;

			// Token: 0x04000377 RID: 887
			private readonly Func<Transform, bool> descendIntoChildren;

			// Token: 0x02000083 RID: 131
			internal class InternalUnsafeRefStack
			{
				// Token: 0x06000456 RID: 1110 RVA: 0x0001ADCC File Offset: 0x00018FCC
				public InternalUnsafeRefStack(int initialStackDepth)
				{
					this.array = new GameObjectExtensions.DescendantsEnumerable.Enumerator[initialStackDepth];
				}

				// Token: 0x06000457 RID: 1111 RVA: 0x0001ADE0 File Offset: 0x00018FE0
				public void Push(ref GameObjectExtensions.DescendantsEnumerable.Enumerator e)
				{
					if (this.size == this.array.Length)
					{
						Array.Resize<GameObjectExtensions.DescendantsEnumerable.Enumerator>(ref this.array, this.array.Length * 2);
					}
					this.array[this.size++] = e;
				}

				// Token: 0x06000458 RID: 1112 RVA: 0x0001AE3C File Offset: 0x0001903C
				public void Reset()
				{
					this.size = 0;
				}

				// Token: 0x04000378 RID: 888
				public static Queue<GameObjectExtensions.DescendantsEnumerable.InternalUnsafeRefStack> RefStackPool = new Queue<GameObjectExtensions.DescendantsEnumerable.InternalUnsafeRefStack>();

				// Token: 0x04000379 RID: 889
				public int size;

				// Token: 0x0400037A RID: 890
				public GameObjectExtensions.DescendantsEnumerable.Enumerator[] array;
			}

			// Token: 0x02000084 RID: 132
			public struct Enumerator : IEnumerator<GameObject>, IEnumerator, IDisposable
			{
				// Token: 0x0600045A RID: 1114 RVA: 0x0001AE54 File Offset: 0x00019054
				internal Enumerator(Transform originTransform, bool withSelf, bool canRun, GameObjectExtensions.DescendantsEnumerable.InternalUnsafeRefStack sharedStack, Func<Transform, bool> descendIntoChildren)
				{
					this.originTransform = originTransform;
					this.withSelf = withSelf;
					this.childCount = ((!canRun) ? 0 : originTransform.childCount);
					this.currentIndex = -1;
					this.canRun = canRun;
					this.current = null;
					this.sharedStack = sharedStack;
					this.descendIntoChildren = descendIntoChildren;
				}

				// Token: 0x0600045B RID: 1115 RVA: 0x0001AEAC File Offset: 0x000190AC
				public bool MoveNext()
				{
					if (!this.canRun)
					{
						return false;
					}
					while (this.sharedStack.size != 0)
					{
						if (this.sharedStack.array[this.sharedStack.size - 1].MoveNextCore(true, out this.current))
						{
							return true;
						}
					}
					if (!this.withSelf && !this.descendIntoChildren(this.originTransform))
					{
						this.canRun = false;
						GameObjectExtensions.DescendantsEnumerable.InternalUnsafeRefStack.RefStackPool.Enqueue(this.sharedStack);
						return false;
					}
					if (this.MoveNextCore(false, out this.current))
					{
						return true;
					}
					this.canRun = false;
					GameObjectExtensions.DescendantsEnumerable.InternalUnsafeRefStack.RefStackPool.Enqueue(this.sharedStack);
					return false;
				}

				// Token: 0x0600045C RID: 1116 RVA: 0x0001AF74 File Offset: 0x00019174
				private bool MoveNextCore(bool peek, out GameObject current)
				{
					if (this.withSelf)
					{
						current = this.originTransform.gameObject;
						this.withSelf = false;
						return true;
					}
					this.currentIndex++;
					if (this.currentIndex >= this.childCount)
					{
						if (peek)
						{
							this.sharedStack.size--;
						}
						current = null;
						return false;
					}
					Transform child = this.originTransform.GetChild(this.currentIndex);
					if (this.descendIntoChildren(child))
					{
						GameObjectExtensions.DescendantsEnumerable.Enumerator enumerator = new GameObjectExtensions.DescendantsEnumerable.Enumerator(child, true, true, this.sharedStack, this.descendIntoChildren);
						this.sharedStack.Push(ref enumerator);
						return this.sharedStack.array[this.sharedStack.size - 1].MoveNextCore(true, out current);
					}
					current = child.gameObject;
					return true;
				}

				// Token: 0x1700004C RID: 76
				// (get) Token: 0x0600045D RID: 1117 RVA: 0x0001B054 File Offset: 0x00019254
				public GameObject Current
				{
					get
					{
						return this.current;
					}
				}

				// Token: 0x1700004B RID: 75
				// (get) Token: 0x0600045E RID: 1118 RVA: 0x0001B05C File Offset: 0x0001925C
				object IEnumerator.Current
				{
					get
					{
						return this.current;
					}
				}

				// Token: 0x0600045F RID: 1119 RVA: 0x0001B064 File Offset: 0x00019264
				public void Dispose()
				{
					if (this.canRun)
					{
						this.canRun = false;
						GameObjectExtensions.DescendantsEnumerable.InternalUnsafeRefStack.RefStackPool.Enqueue(this.sharedStack);
					}
				}

				// Token: 0x06000460 RID: 1120 RVA: 0x0001B088 File Offset: 0x00019288
				public void Reset()
				{
					throw new NotSupportedException();
				}

				// Token: 0x0400037B RID: 891
				private readonly int childCount;

				// Token: 0x0400037C RID: 892
				private readonly Transform originTransform;

				// Token: 0x0400037D RID: 893
				private bool canRun;

				// Token: 0x0400037E RID: 894
				private bool withSelf;

				// Token: 0x0400037F RID: 895
				private int currentIndex;

				// Token: 0x04000380 RID: 896
				private GameObject current;

				// Token: 0x04000381 RID: 897
				private GameObjectExtensions.DescendantsEnumerable.InternalUnsafeRefStack sharedStack;

				// Token: 0x04000382 RID: 898
				private Func<Transform, bool> descendIntoChildren;
			}

			// Token: 0x02000085 RID: 133
			public struct OfComponentEnumerable<T> : IEnumerable<T>, IEnumerable where T : Component
			{
				// Token: 0x06000461 RID: 1121 RVA: 0x0001B090 File Offset: 0x00019290
				public OfComponentEnumerable(ref GameObjectExtensions.DescendantsEnumerable parent)
				{
					this.parent = parent;
				}

				// Token: 0x06000462 RID: 1122 RVA: 0x0001B0A0 File Offset: 0x000192A0
				public GameObjectExtensions.DescendantsEnumerable.OfComponentEnumerator<T> GetEnumerator()
				{
					return new GameObjectExtensions.DescendantsEnumerable.OfComponentEnumerator<T>(ref this.parent);
				}

				// Token: 0x06000463 RID: 1123 RVA: 0x0001B0B0 File Offset: 0x000192B0
				IEnumerator<T> IEnumerable<T>.GetEnumerator()
				{
					return this.GetEnumerator();
				}

				// Token: 0x06000464 RID: 1124 RVA: 0x0001B0C0 File Offset: 0x000192C0
				IEnumerator IEnumerable.GetEnumerator()
				{
					return this.GetEnumerator();
				}

				// Token: 0x06000465 RID: 1125 RVA: 0x0001B0D0 File Offset: 0x000192D0
				public T First()
				{
					T result;
					using (GameObjectExtensions.DescendantsEnumerable.OfComponentEnumerator<T> enumerator = this.GetEnumerator())
					{
						if (!enumerator.MoveNext())
						{
							throw new InvalidOperationException("sequence is empty.");
						}
						result = enumerator.Current;
					}
					return result;
				}

				// Token: 0x06000466 RID: 1126 RVA: 0x0001B124 File Offset: 0x00019324
				public T FirstOrDefault()
				{
					T result;
					using (GameObjectExtensions.DescendantsEnumerable.OfComponentEnumerator<T> enumerator = this.GetEnumerator())
					{
						result = ((!enumerator.MoveNext()) ? ((T)((object)null)) : enumerator.Current);
					}
					return result;
				}

				// Token: 0x06000467 RID: 1127 RVA: 0x0001B178 File Offset: 0x00019378
				public void ForEach(Action<T> action)
				{
					if (this.parent.withSelf)
					{
						T t = (T)((object)null);
						t = this.parent.origin.GetComponent<T>();
						if (t != null)
						{
							action(t);
						}
					}
					Transform transform = this.parent.origin.transform;
					this.OfComponentDescendantsCore(ref transform, ref action);
				}

				// Token: 0x06000468 RID: 1128 RVA: 0x0001B1E0 File Offset: 0x000193E0
				public T[] ToArray()
				{
					T[] array = new T[4];
					int num = this.ToArrayNonAlloc(ref array);
					if (array.Length != num)
					{
						Array.Resize<T>(ref array, num);
					}
					return array;
				}

				// Token: 0x06000469 RID: 1129 RVA: 0x0001B210 File Offset: 0x00019410
				private void OfComponentDescendantsCore(ref Transform transform, ref Action<T> action)
				{
					if (!this.parent.descendIntoChildren(transform))
					{
						return;
					}
					int childCount = transform.childCount;
					for (int i = 0; i < childCount; i++)
					{
						Transform child = transform.GetChild(i);
						T t = (T)((object)null);
						t = child.GetComponent<T>();
						if (t != null)
						{
							action(t);
						}
						this.OfComponentDescendantsCore(ref child, ref action);
					}
				}

				// Token: 0x0600046A RID: 1130 RVA: 0x0001B288 File Offset: 0x00019488
				private void OfComponentDescendantsCore(ref Transform transform, ref int index, ref T[] array)
				{
					if (!this.parent.descendIntoChildren(transform))
					{
						return;
					}
					int childCount = transform.childCount;
					for (int i = 0; i < childCount; i++)
					{
						Transform child = transform.GetChild(i);
						T t = (T)((object)null);
						t = child.GetComponent<T>();
						if (t != null)
						{
							if (array.Length == index)
							{
								int newSize = (index != 0) ? (index * 2) : 4;
								Array.Resize<T>(ref array, newSize);
							}
							array[index++] = t;
						}
						this.OfComponentDescendantsCore(ref child, ref index, ref array);
					}
				}

				// Token: 0x0600046B RID: 1131 RVA: 0x0001B334 File Offset: 0x00019534
				public int ToArrayNonAlloc(ref T[] array)
				{
					int num = 0;
					if (this.parent.withSelf)
					{
						T t = (T)((object)null);
						t = this.parent.origin.GetComponent<T>();
						if (t != null)
						{
							if (array.Length == num)
							{
								int newSize = (num != 0) ? (num * 2) : 4;
								Array.Resize<T>(ref array, newSize);
							}
							array[num++] = t;
						}
					}
					Transform transform = this.parent.origin.transform;
					this.OfComponentDescendantsCore(ref transform, ref num, ref array);
					return num;
				}

				// Token: 0x04000383 RID: 899
				private GameObjectExtensions.DescendantsEnumerable parent;
			}

			// Token: 0x02000086 RID: 134
			public struct OfComponentEnumerator<T> : IEnumerator<T>, IEnumerator, IDisposable where T : Component
			{
				// Token: 0x0600046C RID: 1132 RVA: 0x0001B3C8 File Offset: 0x000195C8
				public OfComponentEnumerator(ref GameObjectExtensions.DescendantsEnumerable parent)
				{
					this.enumerator = parent.GetEnumerator();
					this.current = (T)((object)null);
				}

				// Token: 0x0600046D RID: 1133 RVA: 0x0001B3E4 File Offset: 0x000195E4
				public bool MoveNext()
				{
					while (this.enumerator.MoveNext())
					{
						T component = this.enumerator.Current.GetComponent<T>();
						if (component != null)
						{
							this.current = component;
							return true;
						}
					}
					return false;
				}

				// Token: 0x1700004E RID: 78
				// (get) Token: 0x0600046E RID: 1134 RVA: 0x0001B434 File Offset: 0x00019634
				public T Current
				{
					get
					{
						return this.current;
					}
				}

				// Token: 0x1700004D RID: 77
				// (get) Token: 0x0600046F RID: 1135 RVA: 0x0001B43C File Offset: 0x0001963C
				object IEnumerator.Current
				{
					get
					{
						return this.current;
					}
				}

				// Token: 0x06000470 RID: 1136 RVA: 0x0001B44C File Offset: 0x0001964C
				public void Dispose()
				{
					this.enumerator.Dispose();
				}

				// Token: 0x06000471 RID: 1137 RVA: 0x0001B45C File Offset: 0x0001965C
				public void Reset()
				{
					throw new NotSupportedException();
				}

				// Token: 0x04000384 RID: 900
				private GameObjectExtensions.DescendantsEnumerable.Enumerator enumerator;

				// Token: 0x04000385 RID: 901
				private T current;
			}
		}

		// Token: 0x02000087 RID: 135
		public struct BeforeSelfEnumerable : IEnumerable<GameObject>, IEnumerable
		{
			// Token: 0x06000472 RID: 1138 RVA: 0x0001B464 File Offset: 0x00019664
			public BeforeSelfEnumerable(GameObject origin, bool withSelf)
			{
				this.origin = origin;
				this.withSelf = withSelf;
			}

			// Token: 0x06000473 RID: 1139 RVA: 0x0001B474 File Offset: 0x00019674
			public GameObjectExtensions.BeforeSelfEnumerable.OfComponentEnumerable<T> OfComponent<T>() where T : Component
			{
				return new GameObjectExtensions.BeforeSelfEnumerable.OfComponentEnumerable<T>(ref this);
			}

			// Token: 0x06000474 RID: 1140 RVA: 0x0001B47C File Offset: 0x0001967C
			public void Destroy(bool useDestroyImmediate = false)
			{
				foreach (GameObject self in this)
				{
					self.Destroy(useDestroyImmediate, false);
				}
			}

			// Token: 0x06000475 RID: 1141 RVA: 0x0001B4B0 File Offset: 0x000196B0
			public void Destroy(Func<GameObject, bool> predicate, bool useDestroyImmediate = false)
			{
				foreach (GameObject gameObject in this)
				{
					if (predicate(gameObject))
					{
						gameObject.Destroy(useDestroyImmediate, false);
					}
				}
			}

			// Token: 0x06000476 RID: 1142 RVA: 0x0001B4F4 File Offset: 0x000196F4
			public GameObjectExtensions.BeforeSelfEnumerable.Enumerator GetEnumerator()
			{
				return (!(this.origin == null)) ? new GameObjectExtensions.BeforeSelfEnumerable.Enumerator(this.origin.transform, this.withSelf, true) : new GameObjectExtensions.BeforeSelfEnumerable.Enumerator(null, this.withSelf, false);
			}

			// Token: 0x06000477 RID: 1143 RVA: 0x0001B530 File Offset: 0x00019730
			IEnumerator<GameObject> IEnumerable<GameObject>.GetEnumerator()
			{
				return this.GetEnumerator();
			}

			// Token: 0x06000478 RID: 1144 RVA: 0x0001B540 File Offset: 0x00019740
			IEnumerator IEnumerable.GetEnumerator()
			{
				return this.GetEnumerator();
			}

			// Token: 0x06000479 RID: 1145 RVA: 0x0001B550 File Offset: 0x00019750
			public void ForEach(Action<GameObject> action)
			{
				foreach (GameObject obj in this)
				{
					action(obj);
				}
			}

			// Token: 0x0600047A RID: 1146 RVA: 0x0001B584 File Offset: 0x00019784
			public int ToArrayNonAlloc(ref GameObject[] array)
			{
				int num = 0;
				foreach (GameObject gameObject in this)
				{
					if (array.Length == num)
					{
						int newSize = (num != 0) ? (num * 2) : 4;
						Array.Resize<GameObject>(ref array, newSize);
					}
					array[num++] = gameObject;
				}
				return num;
			}

			// Token: 0x0600047B RID: 1147 RVA: 0x0001B5E0 File Offset: 0x000197E0
			public int ToArrayNonAlloc(Func<GameObject, bool> filter, ref GameObject[] array)
			{
				int num = 0;
				foreach (GameObject gameObject in this)
				{
					if (filter(gameObject))
					{
						if (array.Length == num)
						{
							int newSize = (num != 0) ? (num * 2) : 4;
							Array.Resize<GameObject>(ref array, newSize);
						}
						array[num++] = gameObject;
					}
				}
				return num;
			}

			// Token: 0x0600047C RID: 1148 RVA: 0x0001B64C File Offset: 0x0001984C
			public int ToArrayNonAlloc<T>(Func<GameObject, T> selector, ref T[] array)
			{
				int num = 0;
				foreach (GameObject arg in this)
				{
					if (array.Length == num)
					{
						int newSize = (num != 0) ? (num * 2) : 4;
						Array.Resize<T>(ref array, newSize);
					}
					array[num++] = selector(arg);
				}
				return num;
			}

			// Token: 0x0600047D RID: 1149 RVA: 0x0001B6B0 File Offset: 0x000198B0
			public int ToArrayNonAlloc<T>(Func<GameObject, bool> filter, Func<GameObject, T> selector, ref T[] array)
			{
				int num = 0;
				foreach (GameObject arg in this)
				{
					if (filter(arg))
					{
						if (array.Length == num)
						{
							int newSize = (num != 0) ? (num * 2) : 4;
							Array.Resize<T>(ref array, newSize);
						}
						array[num++] = selector(arg);
					}
				}
				return num;
			}

			// Token: 0x0600047E RID: 1150 RVA: 0x0001B728 File Offset: 0x00019928
			public int ToArrayNonAlloc<TState, T>(Func<GameObject, TState> let, Func<TState, bool> filter, Func<TState, T> selector, ref T[] array)
			{
				int num = 0;
				foreach (GameObject arg in this)
				{
					TState arg2 = let(arg);
					if (filter(arg2))
					{
						if (array.Length == num)
						{
							int newSize = (num != 0) ? (num * 2) : 4;
							Array.Resize<T>(ref array, newSize);
						}
						array[num++] = selector(arg2);
					}
				}
				return num;
			}

			// Token: 0x0600047F RID: 1151 RVA: 0x0001B7AC File Offset: 0x000199AC
			public GameObject[] ToArray()
			{
				GameObject[] array = new GameObject[4];
				int num = this.ToArrayNonAlloc(ref array);
				if (array.Length != num)
				{
					Array.Resize<GameObject>(ref array, num);
				}
				return array;
			}

			// Token: 0x06000480 RID: 1152 RVA: 0x0001B7DC File Offset: 0x000199DC
			public GameObject[] ToArray(Func<GameObject, bool> filter)
			{
				GameObject[] array = new GameObject[4];
				int num = this.ToArrayNonAlloc(filter, ref array);
				if (array.Length != num)
				{
					Array.Resize<GameObject>(ref array, num);
				}
				return array;
			}

			// Token: 0x06000481 RID: 1153 RVA: 0x0001B80C File Offset: 0x00019A0C
			public T[] ToArray<T>(Func<GameObject, T> selector)
			{
				T[] array = new T[4];
				int num = this.ToArrayNonAlloc<T>(selector, ref array);
				if (array.Length != num)
				{
					Array.Resize<T>(ref array, num);
				}
				return array;
			}

			// Token: 0x06000482 RID: 1154 RVA: 0x0001B83C File Offset: 0x00019A3C
			public T[] ToArray<T>(Func<GameObject, bool> filter, Func<GameObject, T> selector)
			{
				T[] array = new T[4];
				int num = this.ToArrayNonAlloc<T>(filter, selector, ref array);
				if (array.Length != num)
				{
					Array.Resize<T>(ref array, num);
				}
				return array;
			}

			// Token: 0x06000483 RID: 1155 RVA: 0x0001B870 File Offset: 0x00019A70
			public T[] ToArray<TState, T>(Func<GameObject, TState> let, Func<TState, bool> filter, Func<TState, T> selector)
			{
				T[] array = new T[4];
				int num = this.ToArrayNonAlloc<TState, T>(let, filter, selector, ref array);
				if (array.Length != num)
				{
					Array.Resize<T>(ref array, num);
				}
				return array;
			}

			// Token: 0x06000484 RID: 1156 RVA: 0x0001B8A4 File Offset: 0x00019AA4
			public GameObject First()
			{
				GameObjectExtensions.BeforeSelfEnumerable.Enumerator enumerator = this.GetEnumerator();
				if (enumerator.MoveNext())
				{
					return enumerator.Current;
				}
				throw new InvalidOperationException("sequence is empty.");
			}

			// Token: 0x06000485 RID: 1157 RVA: 0x0001B8D8 File Offset: 0x00019AD8
			public GameObject FirstOrDefault()
			{
				GameObjectExtensions.BeforeSelfEnumerable.Enumerator enumerator = this.GetEnumerator();
				return (!enumerator.MoveNext()) ? null : enumerator.Current;
			}

			// Token: 0x04000386 RID: 902
			private readonly GameObject origin;

			// Token: 0x04000387 RID: 903
			private readonly bool withSelf;

			// Token: 0x02000088 RID: 136
			public struct Enumerator : IEnumerator<GameObject>, IEnumerator, IDisposable
			{
				// Token: 0x06000486 RID: 1158 RVA: 0x0001B908 File Offset: 0x00019B08
				internal Enumerator(Transform originTransform, bool withSelf, bool canRun)
				{
					this.originTransform = originTransform;
					this.withSelf = withSelf;
					this.currentIndex = -1;
					this.canRun = canRun;
					this.current = null;
					this.parent = originTransform.parent;
					this.childCount = ((!(this.parent != null)) ? 0 : this.parent.childCount);
				}

				// Token: 0x06000487 RID: 1159 RVA: 0x0001B96C File Offset: 0x00019B6C
				public bool MoveNext()
				{
					if (!this.canRun)
					{
						return false;
					}
					if (!(this.parent == null))
					{
						this.currentIndex++;
						if (this.currentIndex < this.childCount)
						{
							Transform child = this.parent.GetChild(this.currentIndex);
							if (!(child == this.originTransform))
							{
								this.current = child.gameObject;
								return true;
							}
						}
					}
					if (this.withSelf)
					{
						this.current = this.originTransform.gameObject;
						this.withSelf = false;
						this.canRun = false;
						return true;
					}
					return false;
				}

				// Token: 0x17000050 RID: 80
				// (get) Token: 0x06000488 RID: 1160 RVA: 0x0001BA20 File Offset: 0x00019C20
				public GameObject Current
				{
					get
					{
						return this.current;
					}
				}

				// Token: 0x1700004F RID: 79
				// (get) Token: 0x06000489 RID: 1161 RVA: 0x0001BA28 File Offset: 0x00019C28
				object IEnumerator.Current
				{
					get
					{
						return this.current;
					}
				}

				// Token: 0x0600048A RID: 1162 RVA: 0x0001BA30 File Offset: 0x00019C30
				public void Dispose()
				{
				}

				// Token: 0x0600048B RID: 1163 RVA: 0x0001BA34 File Offset: 0x00019C34
				public void Reset()
				{
					throw new NotSupportedException();
				}

				// Token: 0x04000388 RID: 904
				private readonly int childCount;

				// Token: 0x04000389 RID: 905
				private readonly Transform originTransform;

				// Token: 0x0400038A RID: 906
				private bool canRun;

				// Token: 0x0400038B RID: 907
				private bool withSelf;

				// Token: 0x0400038C RID: 908
				private int currentIndex;

				// Token: 0x0400038D RID: 909
				private GameObject current;

				// Token: 0x0400038E RID: 910
				private Transform parent;
			}

			// Token: 0x02000089 RID: 137
			public struct OfComponentEnumerable<T> : IEnumerable<T>, IEnumerable where T : Component
			{
				// Token: 0x0600048C RID: 1164 RVA: 0x0001BA3C File Offset: 0x00019C3C
				public OfComponentEnumerable(ref GameObjectExtensions.BeforeSelfEnumerable parent)
				{
					this.parent = parent;
				}

				// Token: 0x0600048D RID: 1165 RVA: 0x0001BA4C File Offset: 0x00019C4C
				public GameObjectExtensions.BeforeSelfEnumerable.OfComponentEnumerator<T> GetEnumerator()
				{
					return new GameObjectExtensions.BeforeSelfEnumerable.OfComponentEnumerator<T>(ref this.parent);
				}

				// Token: 0x0600048E RID: 1166 RVA: 0x0001BA5C File Offset: 0x00019C5C
				IEnumerator<T> IEnumerable<T>.GetEnumerator()
				{
					return this.GetEnumerator();
				}

				// Token: 0x0600048F RID: 1167 RVA: 0x0001BA6C File Offset: 0x00019C6C
				IEnumerator IEnumerable.GetEnumerator()
				{
					return this.GetEnumerator();
				}

				// Token: 0x06000490 RID: 1168 RVA: 0x0001BA7C File Offset: 0x00019C7C
				public void ForEach(Action<T> action)
				{
					foreach (T obj in this)
					{
						action(obj);
					}
				}

				// Token: 0x06000491 RID: 1169 RVA: 0x0001BAB0 File Offset: 0x00019CB0
				public T First()
				{
					GameObjectExtensions.BeforeSelfEnumerable.OfComponentEnumerator<T> enumerator = this.GetEnumerator();
					if (enumerator.MoveNext())
					{
						return enumerator.Current;
					}
					throw new InvalidOperationException("sequence is empty.");
				}

				// Token: 0x06000492 RID: 1170 RVA: 0x0001BAE4 File Offset: 0x00019CE4
				public T FirstOrDefault()
				{
					GameObjectExtensions.BeforeSelfEnumerable.OfComponentEnumerator<T> enumerator = this.GetEnumerator();
					return (!enumerator.MoveNext()) ? ((T)((object)null)) : enumerator.Current;
				}

				// Token: 0x06000493 RID: 1171 RVA: 0x0001BB18 File Offset: 0x00019D18
				public T[] ToArray()
				{
					T[] array = new T[4];
					int num = this.ToArrayNonAlloc(ref array);
					if (array.Length != num)
					{
						Array.Resize<T>(ref array, num);
					}
					return array;
				}

				// Token: 0x06000494 RID: 1172 RVA: 0x0001BB48 File Offset: 0x00019D48
				public int ToArrayNonAlloc(ref T[] array)
				{
					int num = 0;
					GameObjectExtensions.BeforeSelfEnumerable.OfComponentEnumerator<T> enumerator = this.GetEnumerator();
					while (enumerator.MoveNext())
					{
						if (array.Length == num)
						{
							int newSize = (num != 0) ? (num * 2) : 4;
							Array.Resize<T>(ref array, newSize);
						}
						array[num++] = enumerator.Current;
					}
					return num;
				}

				// Token: 0x0400038F RID: 911
				private GameObjectExtensions.BeforeSelfEnumerable parent;
			}

			// Token: 0x0200008A RID: 138
			public struct OfComponentEnumerator<T> : IEnumerator<T>, IEnumerator, IDisposable where T : Component
			{
				// Token: 0x06000495 RID: 1173 RVA: 0x0001BBA4 File Offset: 0x00019DA4
				public OfComponentEnumerator(ref GameObjectExtensions.BeforeSelfEnumerable parent)
				{
					this.enumerator = parent.GetEnumerator();
					this.current = (T)((object)null);
				}

				// Token: 0x06000496 RID: 1174 RVA: 0x0001BBC0 File Offset: 0x00019DC0
				public bool MoveNext()
				{
					while (this.enumerator.MoveNext())
					{
						T component = this.enumerator.Current.GetComponent<T>();
						if (component != null)
						{
							this.current = component;
							return true;
						}
					}
					return false;
				}

				// Token: 0x17000052 RID: 82
				// (get) Token: 0x06000497 RID: 1175 RVA: 0x0001BC10 File Offset: 0x00019E10
				public T Current
				{
					get
					{
						return this.current;
					}
				}

				// Token: 0x17000051 RID: 81
				// (get) Token: 0x06000498 RID: 1176 RVA: 0x0001BC18 File Offset: 0x00019E18
				object IEnumerator.Current
				{
					get
					{
						return this.current;
					}
				}

				// Token: 0x06000499 RID: 1177 RVA: 0x0001BC28 File Offset: 0x00019E28
				public void Dispose()
				{
				}

				// Token: 0x0600049A RID: 1178 RVA: 0x0001BC2C File Offset: 0x00019E2C
				public void Reset()
				{
					throw new NotSupportedException();
				}

				// Token: 0x04000390 RID: 912
				private GameObjectExtensions.BeforeSelfEnumerable.Enumerator enumerator;

				// Token: 0x04000391 RID: 913
				private T current;
			}
		}

		// Token: 0x0200008B RID: 139
		public struct AfterSelfEnumerable : IEnumerable<GameObject>, IEnumerable
		{
			// Token: 0x0600049B RID: 1179 RVA: 0x0001BC34 File Offset: 0x00019E34
			public AfterSelfEnumerable(GameObject origin, bool withSelf)
			{
				this.origin = origin;
				this.withSelf = withSelf;
			}

			// Token: 0x0600049C RID: 1180 RVA: 0x0001BC44 File Offset: 0x00019E44
			public GameObjectExtensions.AfterSelfEnumerable.OfComponentEnumerable<T> OfComponent<T>() where T : Component
			{
				return new GameObjectExtensions.AfterSelfEnumerable.OfComponentEnumerable<T>(ref this);
			}

			// Token: 0x0600049D RID: 1181 RVA: 0x0001BC4C File Offset: 0x00019E4C
			public void Destroy(bool useDestroyImmediate = false)
			{
				foreach (GameObject self in this)
				{
					self.Destroy(useDestroyImmediate, false);
				}
			}

			// Token: 0x0600049E RID: 1182 RVA: 0x0001BC80 File Offset: 0x00019E80
			public void Destroy(Func<GameObject, bool> predicate, bool useDestroyImmediate = false)
			{
				foreach (GameObject gameObject in this)
				{
					if (predicate(gameObject))
					{
						gameObject.Destroy(useDestroyImmediate, false);
					}
				}
			}

			// Token: 0x0600049F RID: 1183 RVA: 0x0001BCC4 File Offset: 0x00019EC4
			public GameObjectExtensions.AfterSelfEnumerable.Enumerator GetEnumerator()
			{
				return (!(this.origin == null)) ? new GameObjectExtensions.AfterSelfEnumerable.Enumerator(this.origin.transform, this.withSelf, true) : new GameObjectExtensions.AfterSelfEnumerable.Enumerator(null, this.withSelf, false);
			}

			// Token: 0x060004A0 RID: 1184 RVA: 0x0001BD00 File Offset: 0x00019F00
			IEnumerator<GameObject> IEnumerable<GameObject>.GetEnumerator()
			{
				return this.GetEnumerator();
			}

			// Token: 0x060004A1 RID: 1185 RVA: 0x0001BD10 File Offset: 0x00019F10
			IEnumerator IEnumerable.GetEnumerator()
			{
				return this.GetEnumerator();
			}

			// Token: 0x060004A2 RID: 1186 RVA: 0x0001BD20 File Offset: 0x00019F20
			public void ForEach(Action<GameObject> action)
			{
				foreach (GameObject obj in this)
				{
					action(obj);
				}
			}

			// Token: 0x060004A3 RID: 1187 RVA: 0x0001BD54 File Offset: 0x00019F54
			public int ToArrayNonAlloc(ref GameObject[] array)
			{
				int num = 0;
				foreach (GameObject gameObject in this)
				{
					if (array.Length == num)
					{
						int newSize = (num != 0) ? (num * 2) : 4;
						Array.Resize<GameObject>(ref array, newSize);
					}
					array[num++] = gameObject;
				}
				return num;
			}

			// Token: 0x060004A4 RID: 1188 RVA: 0x0001BDB0 File Offset: 0x00019FB0
			public int ToArrayNonAlloc(Func<GameObject, bool> filter, ref GameObject[] array)
			{
				int num = 0;
				foreach (GameObject gameObject in this)
				{
					if (filter(gameObject))
					{
						if (array.Length == num)
						{
							int newSize = (num != 0) ? (num * 2) : 4;
							Array.Resize<GameObject>(ref array, newSize);
						}
						array[num++] = gameObject;
					}
				}
				return num;
			}

			// Token: 0x060004A5 RID: 1189 RVA: 0x0001BE1C File Offset: 0x0001A01C
			public int ToArrayNonAlloc<T>(Func<GameObject, T> selector, ref T[] array)
			{
				int num = 0;
				foreach (GameObject arg in this)
				{
					if (array.Length == num)
					{
						int newSize = (num != 0) ? (num * 2) : 4;
						Array.Resize<T>(ref array, newSize);
					}
					array[num++] = selector(arg);
				}
				return num;
			}

			// Token: 0x060004A6 RID: 1190 RVA: 0x0001BE80 File Offset: 0x0001A080
			public int ToArrayNonAlloc<T>(Func<GameObject, bool> filter, Func<GameObject, T> selector, ref T[] array)
			{
				int num = 0;
				foreach (GameObject arg in this)
				{
					if (filter(arg))
					{
						if (array.Length == num)
						{
							int newSize = (num != 0) ? (num * 2) : 4;
							Array.Resize<T>(ref array, newSize);
						}
						array[num++] = selector(arg);
					}
				}
				return num;
			}

			// Token: 0x060004A7 RID: 1191 RVA: 0x0001BEF8 File Offset: 0x0001A0F8
			public int ToArrayNonAlloc<TState, T>(Func<GameObject, TState> let, Func<TState, bool> filter, Func<TState, T> selector, ref T[] array)
			{
				int num = 0;
				foreach (GameObject arg in this)
				{
					TState arg2 = let(arg);
					if (filter(arg2))
					{
						if (array.Length == num)
						{
							int newSize = (num != 0) ? (num * 2) : 4;
							Array.Resize<T>(ref array, newSize);
						}
						array[num++] = selector(arg2);
					}
				}
				return num;
			}

			// Token: 0x060004A8 RID: 1192 RVA: 0x0001BF7C File Offset: 0x0001A17C
			public GameObject[] ToArray()
			{
				GameObject[] array = new GameObject[4];
				int num = this.ToArrayNonAlloc(ref array);
				if (array.Length != num)
				{
					Array.Resize<GameObject>(ref array, num);
				}
				return array;
			}

			// Token: 0x060004A9 RID: 1193 RVA: 0x0001BFAC File Offset: 0x0001A1AC
			public GameObject[] ToArray(Func<GameObject, bool> filter)
			{
				GameObject[] array = new GameObject[4];
				int num = this.ToArrayNonAlloc(filter, ref array);
				if (array.Length != num)
				{
					Array.Resize<GameObject>(ref array, num);
				}
				return array;
			}

			// Token: 0x060004AA RID: 1194 RVA: 0x0001BFDC File Offset: 0x0001A1DC
			public T[] ToArray<T>(Func<GameObject, T> selector)
			{
				T[] array = new T[4];
				int num = this.ToArrayNonAlloc<T>(selector, ref array);
				if (array.Length != num)
				{
					Array.Resize<T>(ref array, num);
				}
				return array;
			}

			// Token: 0x060004AB RID: 1195 RVA: 0x0001C00C File Offset: 0x0001A20C
			public T[] ToArray<T>(Func<GameObject, bool> filter, Func<GameObject, T> selector)
			{
				T[] array = new T[4];
				int num = this.ToArrayNonAlloc<T>(filter, selector, ref array);
				if (array.Length != num)
				{
					Array.Resize<T>(ref array, num);
				}
				return array;
			}

			// Token: 0x060004AC RID: 1196 RVA: 0x0001C040 File Offset: 0x0001A240
			public T[] ToArray<TState, T>(Func<GameObject, TState> let, Func<TState, bool> filter, Func<TState, T> selector)
			{
				T[] array = new T[4];
				int num = this.ToArrayNonAlloc<TState, T>(let, filter, selector, ref array);
				if (array.Length != num)
				{
					Array.Resize<T>(ref array, num);
				}
				return array;
			}

			// Token: 0x060004AD RID: 1197 RVA: 0x0001C074 File Offset: 0x0001A274
			public GameObject First()
			{
				GameObjectExtensions.AfterSelfEnumerable.Enumerator enumerator = this.GetEnumerator();
				if (enumerator.MoveNext())
				{
					return enumerator.Current;
				}
				throw new InvalidOperationException("sequence is empty.");
			}

			// Token: 0x060004AE RID: 1198 RVA: 0x0001C0A8 File Offset: 0x0001A2A8
			public GameObject FirstOrDefault()
			{
				GameObjectExtensions.AfterSelfEnumerable.Enumerator enumerator = this.GetEnumerator();
				return (!enumerator.MoveNext()) ? null : enumerator.Current;
			}

			// Token: 0x04000392 RID: 914
			private readonly GameObject origin;

			// Token: 0x04000393 RID: 915
			private readonly bool withSelf;

			// Token: 0x0200008C RID: 140
			public struct Enumerator : IEnumerator<GameObject>, IEnumerator, IDisposable
			{
				// Token: 0x060004AF RID: 1199 RVA: 0x0001C0D8 File Offset: 0x0001A2D8
				internal Enumerator(Transform originTransform, bool withSelf, bool canRun)
				{
					this.originTransform = originTransform;
					this.withSelf = withSelf;
					this.currentIndex = ((!(originTransform != null)) ? 0 : (originTransform.GetSiblingIndex() + 1));
					this.canRun = canRun;
					this.current = null;
					this.parent = originTransform.parent;
					this.childCount = ((!(this.parent != null)) ? 0 : this.parent.childCount);
				}

				// Token: 0x060004B0 RID: 1200 RVA: 0x0001C158 File Offset: 0x0001A358
				public bool MoveNext()
				{
					if (!this.canRun)
					{
						return false;
					}
					if (this.withSelf)
					{
						this.current = this.originTransform.gameObject;
						this.withSelf = false;
						return true;
					}
					if (this.currentIndex < this.childCount)
					{
						this.current = this.parent.GetChild(this.currentIndex).gameObject;
						this.currentIndex++;
						return true;
					}
					return false;
				}

				// Token: 0x17000054 RID: 84
				// (get) Token: 0x060004B1 RID: 1201 RVA: 0x0001C1D8 File Offset: 0x0001A3D8
				public GameObject Current
				{
					get
					{
						return this.current;
					}
				}

				// Token: 0x17000053 RID: 83
				// (get) Token: 0x060004B2 RID: 1202 RVA: 0x0001C1E0 File Offset: 0x0001A3E0
				object IEnumerator.Current
				{
					get
					{
						return this.current;
					}
				}

				// Token: 0x060004B3 RID: 1203 RVA: 0x0001C1E8 File Offset: 0x0001A3E8
				public void Dispose()
				{
				}

				// Token: 0x060004B4 RID: 1204 RVA: 0x0001C1EC File Offset: 0x0001A3EC
				public void Reset()
				{
					throw new NotSupportedException();
				}

				// Token: 0x04000394 RID: 916
				private readonly int childCount;

				// Token: 0x04000395 RID: 917
				private readonly Transform originTransform;

				// Token: 0x04000396 RID: 918
				private readonly bool canRun;

				// Token: 0x04000397 RID: 919
				private bool withSelf;

				// Token: 0x04000398 RID: 920
				private int currentIndex;

				// Token: 0x04000399 RID: 921
				private GameObject current;

				// Token: 0x0400039A RID: 922
				private Transform parent;
			}

			// Token: 0x0200008D RID: 141
			public struct OfComponentEnumerable<T> : IEnumerable<T>, IEnumerable where T : Component
			{
				// Token: 0x060004B5 RID: 1205 RVA: 0x0001C1F4 File Offset: 0x0001A3F4
				public OfComponentEnumerable(ref GameObjectExtensions.AfterSelfEnumerable parent)
				{
					this.parent = parent;
				}

				// Token: 0x060004B6 RID: 1206 RVA: 0x0001C204 File Offset: 0x0001A404
				public GameObjectExtensions.AfterSelfEnumerable.OfComponentEnumerator<T> GetEnumerator()
				{
					return new GameObjectExtensions.AfterSelfEnumerable.OfComponentEnumerator<T>(ref this.parent);
				}

				// Token: 0x060004B7 RID: 1207 RVA: 0x0001C214 File Offset: 0x0001A414
				IEnumerator<T> IEnumerable<T>.GetEnumerator()
				{
					return this.GetEnumerator();
				}

				// Token: 0x060004B8 RID: 1208 RVA: 0x0001C224 File Offset: 0x0001A424
				IEnumerator IEnumerable.GetEnumerator()
				{
					return this.GetEnumerator();
				}

				// Token: 0x060004B9 RID: 1209 RVA: 0x0001C234 File Offset: 0x0001A434
				public void ForEach(Action<T> action)
				{
					foreach (T obj in this)
					{
						action(obj);
					}
				}

				// Token: 0x060004BA RID: 1210 RVA: 0x0001C268 File Offset: 0x0001A468
				public T First()
				{
					GameObjectExtensions.AfterSelfEnumerable.OfComponentEnumerator<T> enumerator = this.GetEnumerator();
					if (enumerator.MoveNext())
					{
						return enumerator.Current;
					}
					throw new InvalidOperationException("sequence is empty.");
				}

				// Token: 0x060004BB RID: 1211 RVA: 0x0001C29C File Offset: 0x0001A49C
				public T FirstOrDefault()
				{
					GameObjectExtensions.AfterSelfEnumerable.OfComponentEnumerator<T> enumerator = this.GetEnumerator();
					return (!enumerator.MoveNext()) ? ((T)((object)null)) : enumerator.Current;
				}

				// Token: 0x060004BC RID: 1212 RVA: 0x0001C2D0 File Offset: 0x0001A4D0
				public T[] ToArray()
				{
					T[] array = new T[4];
					int num = this.ToArrayNonAlloc(ref array);
					if (array.Length != num)
					{
						Array.Resize<T>(ref array, num);
					}
					return array;
				}

				// Token: 0x060004BD RID: 1213 RVA: 0x0001C300 File Offset: 0x0001A500
				public int ToArrayNonAlloc(ref T[] array)
				{
					int num = 0;
					GameObjectExtensions.AfterSelfEnumerable.OfComponentEnumerator<T> enumerator = this.GetEnumerator();
					while (enumerator.MoveNext())
					{
						if (array.Length == num)
						{
							int newSize = (num != 0) ? (num * 2) : 4;
							Array.Resize<T>(ref array, newSize);
						}
						array[num++] = enumerator.Current;
					}
					return num;
				}

				// Token: 0x0400039B RID: 923
				private GameObjectExtensions.AfterSelfEnumerable parent;
			}

			// Token: 0x0200008E RID: 142
			public struct OfComponentEnumerator<T> : IEnumerator<T>, IEnumerator, IDisposable where T : Component
			{
				// Token: 0x060004BE RID: 1214 RVA: 0x0001C35C File Offset: 0x0001A55C
				public OfComponentEnumerator(ref GameObjectExtensions.AfterSelfEnumerable parent)
				{
					this.enumerator = parent.GetEnumerator();
					this.current = (T)((object)null);
				}

				// Token: 0x060004BF RID: 1215 RVA: 0x0001C378 File Offset: 0x0001A578
				public bool MoveNext()
				{
					while (this.enumerator.MoveNext())
					{
						T component = this.enumerator.Current.GetComponent<T>();
						if (component != null)
						{
							this.current = component;
							return true;
						}
					}
					return false;
				}

				// Token: 0x17000056 RID: 86
				// (get) Token: 0x060004C0 RID: 1216 RVA: 0x0001C3C8 File Offset: 0x0001A5C8
				public T Current
				{
					get
					{
						return this.current;
					}
				}

				// Token: 0x17000055 RID: 85
				// (get) Token: 0x060004C1 RID: 1217 RVA: 0x0001C3D0 File Offset: 0x0001A5D0
				object IEnumerator.Current
				{
					get
					{
						return this.current;
					}
				}

				// Token: 0x060004C2 RID: 1218 RVA: 0x0001C3E0 File Offset: 0x0001A5E0
				public void Dispose()
				{
				}

				// Token: 0x060004C3 RID: 1219 RVA: 0x0001C3E4 File Offset: 0x0001A5E4
				public void Reset()
				{
					throw new NotSupportedException();
				}

				// Token: 0x0400039C RID: 924
				private GameObjectExtensions.AfterSelfEnumerable.Enumerator enumerator;

				// Token: 0x0400039D RID: 925
				private T current;
			}
		}
	}
}
